@@ -150,7 +150,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
150
150
151
151
let trait_predicate = self . infcx . shallow_resolve ( obligation. predicate ) ;
152
152
let placeholder_trait_predicate =
153
- self . infcx . instantiate_binder_with_placeholders ( trait_predicate) . trait_ref ;
153
+ self . infcx . enter_forall_and_leak_universe ( trait_predicate) . trait_ref ;
154
154
let placeholder_self_ty = placeholder_trait_predicate. self_ty ( ) ;
155
155
let placeholder_trait_predicate = ty:: Binder :: dummy ( placeholder_trait_predicate) ;
156
156
let ( def_id, args) = match * placeholder_self_ty. kind ( ) {
@@ -393,7 +393,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
393
393
let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
394
394
395
395
let poly_trait_ref = obligation. predicate . to_poly_trait_ref ( ) ;
396
- let trait_ref = self . infcx . instantiate_binder_with_placeholders ( poly_trait_ref) ;
396
+ let trait_ref = self . infcx . enter_forall_and_leak_universe ( poly_trait_ref) ;
397
397
let trait_obligations: Vec < PredicateObligation < ' _ > > = self . impl_or_trait_obligations (
398
398
& cause,
399
399
obligation. recursion_depth + 1 ,
@@ -484,7 +484,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
484
484
let tcx = self . tcx ( ) ;
485
485
debug ! ( ?obligation, ?index, "confirm_object_candidate" ) ;
486
486
487
- let trait_predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
487
+ let trait_predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
488
488
let self_ty = self . infcx . shallow_resolve ( trait_predicate. self_ty ( ) ) ;
489
489
let obligation_trait_ref = ty:: Binder :: dummy ( trait_predicate. trait_ref ) ;
490
490
let ty:: Dynamic ( data, ..) = * self_ty. kind ( ) else {
@@ -682,7 +682,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
682
682
let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
683
683
684
684
// Confirm the `type Output: Sized;` bound that is present on `FnOnce`
685
- let output_ty = self . infcx . instantiate_binder_with_placeholders ( sig. output ( ) ) ;
685
+ let output_ty = self . infcx . enter_forall_and_leak_universe ( sig. output ( ) ) ;
686
686
let output_ty = normalize_with_depth_to (
687
687
self ,
688
688
obligation. param_env ,
@@ -703,7 +703,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
703
703
) -> Vec < PredicateObligation < ' tcx > > {
704
704
debug ! ( ?obligation, "confirm_trait_alias_candidate" ) ;
705
705
706
- let predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
706
+ let predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
707
707
let trait_ref = predicate. trait_ref ;
708
708
let trait_def_id = trait_ref. def_id ;
709
709
let args = trait_ref. args ;
0 commit comments