@@ -10,7 +10,7 @@ use hir::def_id::DefId;
1010use hir:: LangItem ;
1111use rustc_hir as hir;
1212use rustc_infer:: traits:: ObligationCause ;
13- use rustc_infer:: traits:: { Obligation , SelectionError , TraitObligation } ;
13+ use rustc_infer:: traits:: { Obligation , SelectionError , PolyTraitObligation } ;
1414use rustc_middle:: ty:: fast_reject:: { DeepRejectCtxt , TreatParams } ;
1515use rustc_middle:: ty:: { self , Ty , TypeVisitableExt } ;
1616
@@ -20,7 +20,7 @@ use crate::traits::util;
2020
2121use super :: BuiltinImplConditions ;
2222use super :: SelectionCandidate :: * ;
23- use super :: { SelectionCandidateSet , SelectionContext , TraitObligationStack } ;
23+ use super :: { SelectionCandidateSet , SelectionContext , PolyTraitObligationStack } ;
2424
2525impl < ' cx , ' tcx > SelectionContext < ' cx , ' tcx > {
2626 #[ instrument( skip( self , stack) , level = "debug" ) ]
@@ -137,7 +137,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
137137 #[ instrument( level = "debug" , skip( self , candidates) ) ]
138138 fn assemble_candidates_from_projected_tys (
139139 & mut self ,
140- obligation : & TraitObligation < ' tcx > ,
140+ obligation : & PolyTraitObligation < ' tcx > ,
141141 candidates : & mut SelectionCandidateSet < ' tcx > ,
142142 ) {
143143 // Before we go into the whole placeholder thing, just
@@ -206,7 +206,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
206206
207207 fn assemble_generator_candidates (
208208 & mut self ,
209- obligation : & TraitObligation < ' tcx > ,
209+ obligation : & PolyTraitObligation < ' tcx > ,
210210 candidates : & mut SelectionCandidateSet < ' tcx > ,
211211 ) {
212212 // Okay to skip binder because the substs on generator types never
@@ -231,7 +231,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
231231
232232 fn assemble_future_candidates (
233233 & mut self ,
234- obligation : & TraitObligation < ' tcx > ,
234+ obligation : & PolyTraitObligation < ' tcx > ,
235235 candidates : & mut SelectionCandidateSet < ' tcx > ,
236236 ) {
237237 let self_ty = obligation. self_ty ( ) . skip_binder ( ) ;
@@ -254,7 +254,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
254254 /// unified during the confirmation step.
255255 fn assemble_closure_candidates (
256256 & mut self ,
257- obligation : & TraitObligation < ' tcx > ,
257+ obligation : & PolyTraitObligation < ' tcx > ,
258258 candidates : & mut SelectionCandidateSet < ' tcx > ,
259259 ) {
260260 let Some ( kind) = self . tcx ( ) . fn_trait_kind_from_def_id ( obligation. predicate . def_id ( ) ) else {
@@ -292,7 +292,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
292292 /// Implements one of the `Fn()` family for a fn pointer.
293293 fn assemble_fn_pointer_candidates (
294294 & mut self ,
295- obligation : & TraitObligation < ' tcx > ,
295+ obligation : & PolyTraitObligation < ' tcx > ,
296296 candidates : & mut SelectionCandidateSet < ' tcx > ,
297297 ) {
298298 // We provide impl of all fn traits for fn pointers.
@@ -334,7 +334,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
334334 #[ instrument( level = "debug" , skip( self , candidates) ) ]
335335 fn assemble_candidates_from_impls (
336336 & mut self ,
337- obligation : & TraitObligation < ' tcx > ,
337+ obligation : & PolyTraitObligation < ' tcx > ,
338338 candidates : & mut SelectionCandidateSet < ' tcx > ,
339339 ) {
340340 // Essentially any user-written impl will match with an error type,
@@ -390,7 +390,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
390390 fn reject_fn_ptr_impls (
391391 & mut self ,
392392 impl_def_id : DefId ,
393- obligation : & TraitObligation < ' tcx > ,
393+ obligation : & PolyTraitObligation < ' tcx > ,
394394 impl_self_ty : Ty < ' tcx > ,
395395 ) -> bool {
396396 // Let `impl<T: FnPtr> Trait for Vec<T>` go through the normal rejection path.
@@ -475,7 +475,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
475475
476476 fn assemble_candidates_from_auto_impls (
477477 & mut self ,
478- obligation : & TraitObligation < ' tcx > ,
478+ obligation : & PolyTraitObligation < ' tcx > ,
479479 candidates : & mut SelectionCandidateSet < ' tcx > ,
480480 ) {
481481 // Okay to skip binder here because the tests we do below do not involve bound regions.
@@ -544,7 +544,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
544544 /// Searches for impls that might apply to `obligation`.
545545 fn assemble_candidates_from_object_ty (
546546 & mut self ,
547- obligation : & TraitObligation < ' tcx > ,
547+ obligation : & PolyTraitObligation < ' tcx > ,
548548 candidates : & mut SelectionCandidateSet < ' tcx > ,
549549 ) {
550550 debug ! (
@@ -668,7 +668,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
668668 /// Searches for unsizing that might apply to `obligation`.
669669 fn assemble_candidates_for_unsizing (
670670 & mut self ,
671- obligation : & TraitObligation < ' tcx > ,
671+ obligation : & PolyTraitObligation < ' tcx > ,
672672 candidates : & mut SelectionCandidateSet < ' tcx > ,
673673 ) {
674674 // We currently never consider higher-ranked obligations e.g.
@@ -782,7 +782,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
782782 #[ instrument( level = "debug" , skip( self , obligation, candidates) ) ]
783783 fn assemble_candidates_for_transmutability (
784784 & mut self ,
785- obligation : & TraitObligation < ' tcx > ,
785+ obligation : & PolyTraitObligation < ' tcx > ,
786786 candidates : & mut SelectionCandidateSet < ' tcx > ,
787787 ) {
788788 if obligation. predicate . has_non_region_param ( ) {
@@ -800,7 +800,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
800800 #[ instrument( level = "debug" , skip( self , obligation, candidates) ) ]
801801 fn assemble_candidates_for_trait_alias (
802802 & mut self ,
803- obligation : & TraitObligation < ' tcx > ,
803+ obligation : & PolyTraitObligation < ' tcx > ,
804804 candidates : & mut SelectionCandidateSet < ' tcx > ,
805805 ) {
806806 // Okay to skip binder here because the tests we do below do not involve bound regions.
@@ -837,7 +837,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
837837
838838 fn assemble_const_destruct_candidates (
839839 & mut self ,
840- obligation : & TraitObligation < ' tcx > ,
840+ obligation : & PolyTraitObligation < ' tcx > ,
841841 candidates : & mut SelectionCandidateSet < ' tcx > ,
842842 ) {
843843 // If the predicate is `~const Destruct` in a non-const environment, we don't actually need
@@ -924,7 +924,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
924924
925925 fn assemble_candidate_for_tuple (
926926 & mut self ,
927- obligation : & TraitObligation < ' tcx > ,
927+ obligation : & PolyTraitObligation < ' tcx > ,
928928 candidates : & mut SelectionCandidateSet < ' tcx > ,
929929 ) {
930930 let self_ty = self . infcx . shallow_resolve ( obligation. self_ty ( ) . skip_binder ( ) ) ;
@@ -966,7 +966,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
966966
967967 fn assemble_candidate_for_pointer_like (
968968 & mut self ,
969- obligation : & TraitObligation < ' tcx > ,
969+ obligation : & PolyTraitObligation < ' tcx > ,
970970 candidates : & mut SelectionCandidateSet < ' tcx > ,
971971 ) {
972972 // The regions of a type don't affect the size of the type
@@ -991,7 +991,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
991991
992992 fn assemble_candidates_for_fn_ptr_trait (
993993 & mut self ,
994- obligation : & TraitObligation < ' tcx > ,
994+ obligation : & PolyTraitObligation < ' tcx > ,
995995 candidates : & mut SelectionCandidateSet < ' tcx > ,
996996 ) {
997997 let self_ty = self . infcx . shallow_resolve ( obligation. self_ty ( ) ) ;
0 commit comments