@@ -4,12 +4,12 @@ use rustc_data_structures::obligation_forest::ProcessResult;
4
4
use rustc_data_structures:: obligation_forest:: { Error , ForestObligation , Outcome } ;
5
5
use rustc_data_structures:: obligation_forest:: { ObligationForest , ObligationProcessor } ;
6
6
use rustc_infer:: traits:: ProjectionCacheKey ;
7
- use rustc_infer:: traits:: { SelectionError , TraitEngine , TraitEngineExt as _ , TraitObligation } ;
7
+ use rustc_infer:: traits:: { SelectionError , TraitEngine , TraitObligation } ;
8
8
use rustc_middle:: mir:: interpret:: ErrorHandled ;
9
9
use rustc_middle:: ty:: abstract_const:: NotConstEvaluatable ;
10
10
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
11
11
use rustc_middle:: ty:: subst:: SubstsRef ;
12
- use rustc_middle:: ty:: { self , Binder , Const , Ty , TypeVisitable } ;
12
+ use rustc_middle:: ty:: { self , Binder , Const , TypeVisitable } ;
13
13
use std:: marker:: PhantomData ;
14
14
15
15
use super :: const_evaluatable;
@@ -20,9 +20,9 @@ use super::CodeAmbiguity;
20
20
use super :: CodeProjectionError ;
21
21
use super :: CodeSelectionError ;
22
22
use super :: EvaluationResult ;
23
+ use super :: PredicateObligation ;
23
24
use super :: Unimplemented ;
24
25
use super :: { FulfillmentError , FulfillmentErrorCode } ;
25
- use super :: { ObligationCause , PredicateObligation } ;
26
26
27
27
use crate :: traits:: project:: PolyProjectionObligation ;
28
28
use crate :: traits:: project:: ProjectionCacheKeyExt as _;
@@ -126,42 +126,6 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
126
126
}
127
127
128
128
impl < ' tcx > TraitEngine < ' tcx > for FulfillmentContext < ' tcx > {
129
- /// "Normalize" a projection type `<SomeType as SomeTrait>::X` by
130
- /// creating a fresh type variable `$0` as well as a projection
131
- /// predicate `<SomeType as SomeTrait>::X == $0`. When the
132
- /// inference engine runs, it will attempt to find an impl of
133
- /// `SomeTrait` or a where-clause that lets us unify `$0` with
134
- /// something concrete. If this fails, we'll unify `$0` with
135
- /// `projection_ty` again.
136
- #[ instrument( level = "debug" , skip( self , infcx, param_env, cause) ) ]
137
- fn normalize_projection_type (
138
- & mut self ,
139
- infcx : & InferCtxt < ' tcx > ,
140
- param_env : ty:: ParamEnv < ' tcx > ,
141
- projection_ty : ty:: ProjectionTy < ' tcx > ,
142
- cause : ObligationCause < ' tcx > ,
143
- ) -> Ty < ' tcx > {
144
- debug_assert ! ( !projection_ty. has_escaping_bound_vars( ) ) ;
145
-
146
- // FIXME(#20304) -- cache
147
-
148
- let mut selcx = SelectionContext :: new ( infcx) ;
149
- let mut obligations = vec ! [ ] ;
150
- let normalized_ty = project:: normalize_projection_type (
151
- & mut selcx,
152
- param_env,
153
- projection_ty,
154
- cause,
155
- 0 ,
156
- & mut obligations,
157
- ) ;
158
- self . register_predicate_obligations ( infcx, obligations) ;
159
-
160
- debug ! ( ?normalized_ty) ;
161
-
162
- normalized_ty. ty ( ) . unwrap ( )
163
- }
164
-
165
129
fn register_predicate_obligation (
166
130
& mut self ,
167
131
infcx : & InferCtxt < ' tcx > ,
0 commit comments