@@ -159,7 +159,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
159
159
160
160
let trait_predicate = self . infcx . shallow_resolve ( obligation. predicate ) ;
161
161
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 ;
163
163
let placeholder_self_ty = placeholder_trait_predicate. self_ty ( ) ;
164
164
let placeholder_trait_predicate = ty:: Binder :: dummy ( placeholder_trait_predicate) ;
165
165
let ( def_id, args) = match * placeholder_self_ty. kind ( ) {
@@ -402,7 +402,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
402
402
let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
403
403
404
404
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) ;
406
406
let trait_obligations: Vec < PredicateObligation < ' _ > > = self . impl_or_trait_obligations (
407
407
& cause,
408
408
obligation. recursion_depth + 1 ,
@@ -493,7 +493,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
493
493
let tcx = self . tcx ( ) ;
494
494
debug ! ( ?obligation, ?index, "confirm_object_candidate" ) ;
495
495
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 ) ;
497
497
let self_ty = self . infcx . shallow_resolve ( trait_predicate. self_ty ( ) ) ;
498
498
let obligation_trait_ref = ty:: Binder :: dummy ( trait_predicate. trait_ref ) ;
499
499
let ty:: Dynamic ( data, ..) = * self_ty. kind ( ) else {
@@ -691,7 +691,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
691
691
let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
692
692
693
693
// 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 ( ) ) ;
695
695
let output_ty = normalize_with_depth_to (
696
696
self ,
697
697
obligation. param_env ,
@@ -712,7 +712,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
712
712
) -> Vec < PredicateObligation < ' tcx > > {
713
713
debug ! ( ?obligation, "confirm_trait_alias_candidate" ) ;
714
714
715
- let predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
715
+ let predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
716
716
let trait_ref = predicate. trait_ref ;
717
717
let trait_def_id = trait_ref. def_id ;
718
718
let args = trait_ref. args ;
0 commit comments