Skip to content

Commit 55330f6

Browse files
Fix subst issue with object_ty_for_trait
1 parent a00e24d commit 55330f6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_trait_selection/src/traits/object_safety.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,9 @@ fn object_ty_for_trait<'tcx>(
646646
debug!(?obligation);
647647
let pred = obligation.predicate.to_opt_poly_projection_pred()?;
648648
Some(pred.map_bound(|p| {
649-
ty::ExistentialPredicate::Projection(ty::ExistentialProjection {
650-
def_id: p.projection_ty.def_id,
651-
substs: p.projection_ty.substs,
652-
term: p.term,
653-
})
649+
ty::ExistentialPredicate::Projection(ty::ExistentialProjection::erase_self_ty(
650+
tcx, p,
651+
))
654652
}))
655653
})
656654
.collect();

0 commit comments

Comments
 (0)