ProjectionTy.item_def_id -> ProjectionTy.def_id

This commit is contained in:
Michael Goulet 2022-11-26 21:21:20 +00:00
parent 7f3af72606
commit 5c6afb850c
50 changed files with 164 additions and 186 deletions

View file

@ -123,13 +123,13 @@ where
projection: ty::ProjectionTy<'tcx>,
) -> ControlFlow<V::BreakTy> {
let tcx = self.def_id_visitor.tcx();
let (trait_ref, assoc_substs) = if tcx.def_kind(projection.item_def_id)
let (trait_ref, assoc_substs) = if tcx.def_kind(projection.def_id)
!= DefKind::ImplTraitPlaceholder
{
projection.trait_ref_and_own_substs(tcx)
} else {
// HACK(RPITIT): Remove this when RPITITs are lowered to regular assoc tys
let def_id = tcx.impl_trait_in_trait_parent(projection.item_def_id);
let def_id = tcx.impl_trait_in_trait_parent(projection.def_id);
let trait_generics = tcx.generics_of(def_id);
(
ty::TraitRef { def_id, substs: projection.substs.truncate_to(tcx, trait_generics) },