X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_typeck%2Fsrc%2Fcollect%2Fitem_bounds.rs;h=0d2b75d3328fcc3bfb27b9ac27d48db7414b2a4d;hb=9b8cfc1eed5eb282c97cee4bbabf9acbdebc5dee;hp=8801d0260bffce02a0074f5dd49315a7d15da7c5;hpb=43acb501b93c637b32fa134ba8cf586d82e96732;p=rust.git diff --git a/compiler/rustc_typeck/src/collect/item_bounds.rs b/compiler/rustc_typeck/src/collect/item_bounds.rs index 8801d0260bf..0d2b75d3328 100644 --- a/compiler/rustc_typeck/src/collect/item_bounds.rs +++ b/compiler/rustc_typeck/src/collect/item_bounds.rs @@ -3,7 +3,7 @@ use rustc_hir as hir; use rustc_infer::traits::util; use rustc_middle::ty::subst::InternalSubsts; -use rustc_middle::ty::{self, TyCtxt}; +use rustc_middle::ty::{self, DefIdTree, TyCtxt}; use rustc_span::def_id::DefId; use rustc_span::Span; @@ -30,7 +30,7 @@ fn associated_type_bounds<'tcx>( // Associated types are implicitly sized unless a `?Sized` bound is found >::add_implicitly_sized(&icx, &mut bounds, ast_bounds, None, span); - let trait_def_id = tcx.associated_item(assoc_item_def_id).container.id(); + let trait_def_id = tcx.parent(assoc_item_def_id); let trait_predicates = tcx.trait_explicit_predicates_and_bounds(trait_def_id.expect_local()); let bounds_from_parent = trait_predicates.predicates.iter().copied().filter(|(pred, _)| {