@@ -10,7 +10,7 @@ use hir::def_id::DefId;
10
10
use hir:: LangItem ;
11
11
use rustc_hir as hir;
12
12
use rustc_infer:: traits:: ObligationCause ;
13
- use rustc_infer:: traits:: { Obligation , SelectionError , TraitObligation } ;
13
+ use rustc_infer:: traits:: { Obligation , SelectionError , PolyTraitObligation } ;
14
14
use rustc_middle:: ty:: fast_reject:: { DeepRejectCtxt , TreatParams } ;
15
15
use rustc_middle:: ty:: { self , Ty , TypeVisitableExt } ;
16
16
@@ -20,7 +20,7 @@ use crate::traits::util;
20
20
21
21
use super :: BuiltinImplConditions ;
22
22
use super :: SelectionCandidate :: * ;
23
- use super :: { SelectionCandidateSet , SelectionContext , TraitObligationStack } ;
23
+ use super :: { SelectionCandidateSet , SelectionContext , PolyTraitObligationStack } ;
24
24
25
25
impl < ' cx , ' tcx > SelectionContext < ' cx , ' tcx > {
26
26
#[ instrument( skip( self , stack) , level = "debug" ) ]
@@ -137,7 +137,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
137
137
#[ instrument( level = "debug" , skip( self , candidates) ) ]
138
138
fn assemble_candidates_from_projected_tys (
139
139
& mut self ,
140
- obligation : & TraitObligation < ' tcx > ,
140
+ obligation : & PolyTraitObligation < ' tcx > ,
141
141
candidates : & mut SelectionCandidateSet < ' tcx > ,
142
142
) {
143
143
// Before we go into the whole placeholder thing, just
@@ -206,7 +206,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
206
206
207
207
fn assemble_generator_candidates (
208
208
& mut self ,
209
- obligation : & TraitObligation < ' tcx > ,
209
+ obligation : & PolyTraitObligation < ' tcx > ,
210
210
candidates : & mut SelectionCandidateSet < ' tcx > ,
211
211
) {
212
212
// Okay to skip binder because the substs on generator types never
@@ -231,7 +231,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
231
231
232
232
fn assemble_future_candidates (
233
233
& mut self ,
234
- obligation : & TraitObligation < ' tcx > ,
234
+ obligation : & PolyTraitObligation < ' tcx > ,
235
235
candidates : & mut SelectionCandidateSet < ' tcx > ,
236
236
) {
237
237
let self_ty = obligation. self_ty ( ) . skip_binder ( ) ;
@@ -254,7 +254,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
254
254
/// unified during the confirmation step.
255
255
fn assemble_closure_candidates (
256
256
& mut self ,
257
- obligation : & TraitObligation < ' tcx > ,
257
+ obligation : & PolyTraitObligation < ' tcx > ,
258
258
candidates : & mut SelectionCandidateSet < ' tcx > ,
259
259
) {
260
260
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> {
292
292
/// Implements one of the `Fn()` family for a fn pointer.
293
293
fn assemble_fn_pointer_candidates (
294
294
& mut self ,
295
- obligation : & TraitObligation < ' tcx > ,
295
+ obligation : & PolyTraitObligation < ' tcx > ,
296
296
candidates : & mut SelectionCandidateSet < ' tcx > ,
297
297
) {
298
298
// We provide impl of all fn traits for fn pointers.
@@ -334,7 +334,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
334
334
#[ instrument( level = "debug" , skip( self , candidates) ) ]
335
335
fn assemble_candidates_from_impls (
336
336
& mut self ,
337
- obligation : & TraitObligation < ' tcx > ,
337
+ obligation : & PolyTraitObligation < ' tcx > ,
338
338
candidates : & mut SelectionCandidateSet < ' tcx > ,
339
339
) {
340
340
// Essentially any user-written impl will match with an error type,
@@ -390,7 +390,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
390
390
fn reject_fn_ptr_impls (
391
391
& mut self ,
392
392
impl_def_id : DefId ,
393
- obligation : & TraitObligation < ' tcx > ,
393
+ obligation : & PolyTraitObligation < ' tcx > ,
394
394
impl_self_ty : Ty < ' tcx > ,
395
395
) -> bool {
396
396
// Let `impl<T: FnPtr> Trait for Vec<T>` go through the normal rejection path.
@@ -475,7 +475,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
475
475
476
476
fn assemble_candidates_from_auto_impls (
477
477
& mut self ,
478
- obligation : & TraitObligation < ' tcx > ,
478
+ obligation : & PolyTraitObligation < ' tcx > ,
479
479
candidates : & mut SelectionCandidateSet < ' tcx > ,
480
480
) {
481
481
// 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> {
544
544
/// Searches for impls that might apply to `obligation`.
545
545
fn assemble_candidates_from_object_ty (
546
546
& mut self ,
547
- obligation : & TraitObligation < ' tcx > ,
547
+ obligation : & PolyTraitObligation < ' tcx > ,
548
548
candidates : & mut SelectionCandidateSet < ' tcx > ,
549
549
) {
550
550
debug ! (
@@ -668,7 +668,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
668
668
/// Searches for unsizing that might apply to `obligation`.
669
669
fn assemble_candidates_for_unsizing (
670
670
& mut self ,
671
- obligation : & TraitObligation < ' tcx > ,
671
+ obligation : & PolyTraitObligation < ' tcx > ,
672
672
candidates : & mut SelectionCandidateSet < ' tcx > ,
673
673
) {
674
674
// We currently never consider higher-ranked obligations e.g.
@@ -782,7 +782,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
782
782
#[ instrument( level = "debug" , skip( self , obligation, candidates) ) ]
783
783
fn assemble_candidates_for_transmutability (
784
784
& mut self ,
785
- obligation : & TraitObligation < ' tcx > ,
785
+ obligation : & PolyTraitObligation < ' tcx > ,
786
786
candidates : & mut SelectionCandidateSet < ' tcx > ,
787
787
) {
788
788
if obligation. predicate . has_non_region_param ( ) {
@@ -800,7 +800,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
800
800
#[ instrument( level = "debug" , skip( self , obligation, candidates) ) ]
801
801
fn assemble_candidates_for_trait_alias (
802
802
& mut self ,
803
- obligation : & TraitObligation < ' tcx > ,
803
+ obligation : & PolyTraitObligation < ' tcx > ,
804
804
candidates : & mut SelectionCandidateSet < ' tcx > ,
805
805
) {
806
806
// 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> {
837
837
838
838
fn assemble_const_destruct_candidates (
839
839
& mut self ,
840
- obligation : & TraitObligation < ' tcx > ,
840
+ obligation : & PolyTraitObligation < ' tcx > ,
841
841
candidates : & mut SelectionCandidateSet < ' tcx > ,
842
842
) {
843
843
// 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> {
924
924
925
925
fn assemble_candidate_for_tuple (
926
926
& mut self ,
927
- obligation : & TraitObligation < ' tcx > ,
927
+ obligation : & PolyTraitObligation < ' tcx > ,
928
928
candidates : & mut SelectionCandidateSet < ' tcx > ,
929
929
) {
930
930
let self_ty = self . infcx . shallow_resolve ( obligation. self_ty ( ) . skip_binder ( ) ) ;
@@ -966,7 +966,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
966
966
967
967
fn assemble_candidate_for_pointer_like (
968
968
& mut self ,
969
- obligation : & TraitObligation < ' tcx > ,
969
+ obligation : & PolyTraitObligation < ' tcx > ,
970
970
candidates : & mut SelectionCandidateSet < ' tcx > ,
971
971
) {
972
972
// The regions of a type don't affect the size of the type
@@ -991,7 +991,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
991
991
992
992
fn assemble_candidates_for_fn_ptr_trait (
993
993
& mut self ,
994
- obligation : & TraitObligation < ' tcx > ,
994
+ obligation : & PolyTraitObligation < ' tcx > ,
995
995
candidates : & mut SelectionCandidateSet < ' tcx > ,
996
996
) {
997
997
let self_ty = self . infcx . shallow_resolve ( obligation. self_ty ( ) ) ;
0 commit comments