@@ -159,7 +159,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
159159
160160 let trait_predicate = self . infcx . shallow_resolve ( obligation. predicate ) ;
161161 let placeholder_trait_predicate =
162- self . infcx . instantiate_binder_with_placeholders ( trait_predicate) . trait_ref ;
162+ self . infcx . enter_forall_and_leak_universe ( trait_predicate) . trait_ref ;
163163 let placeholder_self_ty = placeholder_trait_predicate. self_ty ( ) ;
164164 let placeholder_trait_predicate = ty:: Binder :: dummy ( placeholder_trait_predicate) ;
165165 let ( def_id, args) = match * placeholder_self_ty. kind ( ) {
@@ -402,7 +402,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
402402 let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
403403
404404 let poly_trait_ref = obligation. predicate . to_poly_trait_ref ( ) ;
405- let trait_ref = self . infcx . instantiate_binder_with_placeholders ( poly_trait_ref) ;
405+ let trait_ref = self . infcx . enter_forall_and_leak_universe ( poly_trait_ref) ;
406406 let trait_obligations: Vec < PredicateObligation < ' _ > > = self . impl_or_trait_obligations (
407407 & cause,
408408 obligation. recursion_depth + 1 ,
@@ -493,7 +493,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
493493 let tcx = self . tcx ( ) ;
494494 debug ! ( ?obligation, ?index, "confirm_object_candidate" ) ;
495495
496- let trait_predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
496+ let trait_predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
497497 let self_ty = self . infcx . shallow_resolve ( trait_predicate. self_ty ( ) ) ;
498498 let obligation_trait_ref = ty:: Binder :: dummy ( trait_predicate. trait_ref ) ;
499499 let ty:: Dynamic ( data, ..) = * self_ty. kind ( ) else {
@@ -691,7 +691,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
691691 let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
692692
693693 // Confirm the `type Output: Sized;` bound that is present on `FnOnce`
694- let output_ty = self . infcx . instantiate_binder_with_placeholders ( sig. output ( ) ) ;
694+ let output_ty = self . infcx . enter_forall_and_leak_universe ( sig. output ( ) ) ;
695695 let output_ty = normalize_with_depth_to (
696696 self ,
697697 obligation. param_env ,
@@ -712,7 +712,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
712712 ) -> Vec < PredicateObligation < ' tcx > > {
713713 debug ! ( ?obligation, "confirm_trait_alias_candidate" ) ;
714714
715- let predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
715+ let predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
716716 let trait_ref = predicate. trait_ref ;
717717 let trait_def_id = trait_ref. def_id ;
718718 let args = trait_ref. args ;
0 commit comments