about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-02-08 02:34:23 +0000
committerMichael Goulet <michael@errs.io>2023-02-09 17:16:47 +0000
commit8dadd54f52c44f829ba95d0f483ee155b1f2e19b (patch)
tree03a26de433c62aae34c445bbbc686b6f09d1d136 /compiler/rustc_trait_selection/src
parent8cca42a47f5d574c8f7302c98c3f918cdc772fbb (diff)
downloadrust-8dadd54f52c44f829ba95d0f483ee155b1f2e19b.tar.gz
rust-8dadd54f52c44f829ba95d0f483ee155b1f2e19b.zip
Fix subst issue with object_ty_for_trait
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/object_safety.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs
index 8f548acfd2e..bafa2981a87 100644
--- a/compiler/rustc_trait_selection/src/traits/object_safety.rs
+++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs
@@ -646,11 +646,9 @@ fn object_ty_for_trait<'tcx>(
             debug!(?obligation);
             let pred = obligation.predicate.to_opt_poly_projection_pred()?;
             Some(pred.map_bound(|p| {
-                ty::ExistentialPredicate::Projection(ty::ExistentialProjection {
-                    def_id: p.projection_ty.def_id,
-                    substs: p.projection_ty.substs,
-                    term: p.term,
-                })
+                ty::ExistentialPredicate::Projection(ty::ExistentialProjection::erase_self_ty(
+                    tcx, p,
+                ))
             }))
         })
         .collect();