avoid more ty::Binder:dummy

This commit is contained in:
lcnr
2023-08-03 14:16:26 +02:00
parent c115ec11d2
commit a090b4548d
8 changed files with 29 additions and 36 deletions

View File

@@ -857,12 +857,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
ecx.add_goals(
constituent_tys(ecx, goal.predicate.self_ty())?
.into_iter()
.map(|ty| {
goal.with(
ecx.tcx(),
ty::Binder::dummy(goal.predicate.with_self_ty(ecx.tcx(), ty)),
)
})
.map(|ty| goal.with(ecx.tcx(), goal.predicate.with_self_ty(ecx.tcx(), ty)))
.collect::<Vec<_>>(),
);
ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
@@ -905,10 +900,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
let normalizes_to_goal = Goal::new(
ecx.tcx(),
param_env,
ty::Binder::dummy(ty::ProjectionPredicate {
projection_ty,
term: normalized_ty.into(),
}),
ty::ProjectionPredicate { projection_ty, term: normalized_ty.into() },
);
ecx.add_goal(normalizes_to_goal);
if let Err(err) = ecx.try_evaluate_added_goals() {