@@ -150,7 +150,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
150150
151151 let trait_predicate = self . infcx . shallow_resolve ( obligation. predicate ) ;
152152 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 ;
154154 let placeholder_self_ty = placeholder_trait_predicate. self_ty ( ) ;
155155 let placeholder_trait_predicate = ty:: Binder :: dummy ( placeholder_trait_predicate) ;
156156 let ( def_id, args) = match * placeholder_self_ty. kind ( ) {
@@ -393,7 +393,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
393393 let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
394394
395395 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) ;
397397 let trait_obligations: Vec < PredicateObligation < ' _ > > = self . impl_or_trait_obligations (
398398 & cause,
399399 obligation. recursion_depth + 1 ,
@@ -484,7 +484,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
484484 let tcx = self . tcx ( ) ;
485485 debug ! ( ?obligation, ?index, "confirm_object_candidate" ) ;
486486
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 ) ;
488488 let self_ty = self . infcx . shallow_resolve ( trait_predicate. self_ty ( ) ) ;
489489 let obligation_trait_ref = ty:: Binder :: dummy ( trait_predicate. trait_ref ) ;
490490 let ty:: Dynamic ( data, ..) = * self_ty. kind ( ) else {
@@ -682,7 +682,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
682682 let cause = obligation. derived_cause ( BuiltinDerivedObligation ) ;
683683
684684 // 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 ( ) ) ;
686686 let output_ty = normalize_with_depth_to (
687687 self ,
688688 obligation. param_env ,
@@ -703,7 +703,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
703703 ) -> Vec < PredicateObligation < ' tcx > > {
704704 debug ! ( ?obligation, "confirm_trait_alias_candidate" ) ;
705705
706- let predicate = self . infcx . instantiate_binder_with_placeholders ( obligation. predicate ) ;
706+ let predicate = self . infcx . enter_forall_and_leak_universe ( obligation. predicate ) ;
707707 let trait_ref = predicate. trait_ref ;
708708 let trait_def_id = trait_ref. def_id ;
709709 let args = trait_ref. args ;
0 commit comments