Skip to content

Commit c062131

Browse files
Ensure proper item queries for assoc tys
1 parent 0fb279b commit c062131

File tree

1 file changed

+7
-4
lines changed
  • compiler/rustc_hir_analysis/src/check

1 file changed

+7
-4
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
889889
tcx.ensure_ok().predicates_of(def_id);
890890
tcx.ensure_ok().explicit_item_bounds(def_id);
891891
tcx.ensure_ok().explicit_item_self_bounds(def_id);
892-
tcx.ensure_ok().item_bounds(def_id);
893-
tcx.ensure_ok().item_self_bounds(def_id);
894892
if tcx.is_conditionally_const(def_id) {
895893
tcx.ensure_ok().explicit_implied_const_bounds(def_id);
896894
tcx.ensure_ok().const_conditions(def_id);
@@ -1042,8 +1040,13 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
10421040
let has_type = match assoc_item.container {
10431041
ty::AssocItemContainer::Impl => true,
10441042
ty::AssocItemContainer::Trait => {
1045-
tcx.ensure_ok().item_bounds(def_id);
1046-
tcx.ensure_ok().item_self_bounds(def_id);
1043+
tcx.ensure_ok().predicates_of(def_id);
1044+
tcx.ensure_ok().explicit_item_bounds(def_id);
1045+
tcx.ensure_ok().explicit_item_self_bounds(def_id);
1046+
if tcx.is_conditionally_const(def_id) {
1047+
tcx.ensure_ok().explicit_implied_const_bounds(def_id);
1048+
tcx.ensure_ok().const_conditions(def_id);
1049+
}
10471050
res = res.and(check_trait_item(tcx, def_id));
10481051
assoc_item.defaultness(tcx).has_value()
10491052
}

0 commit comments

Comments
 (0)