@@ -58,30 +58,6 @@ pub enum TreatParams {
58
58
/// This also treats projections with inference variables as infer vars
59
59
/// since they could be further normalized.
60
60
ForLookup ,
61
- /// Treat parameters as placeholders in the given environment. This is the
62
- /// correct mode for *lookup*, as during candidate selection.
63
- ///
64
- /// N.B. during deep rejection, this acts identically to `ForLookup`.
65
- ///
66
- /// FIXME(-Znext-solver): Remove this variant and cleanup
67
- /// the code.
68
- NextSolverLookup ,
69
- }
70
-
71
- /// During fast-rejection, we have the choice of treating projection types
72
- /// as either simplifiable or not, depending on whether we expect the projection
73
- /// to be normalized/rigid.
74
- #[ derive( PartialEq , Eq , Debug , Clone , Copy ) ]
75
- pub enum TreatProjections {
76
- /// In the old solver we don't try to normalize projections
77
- /// when looking up impls and only access them by using the
78
- /// current self type. This means that if the self type is
79
- /// a projection which could later be normalized, we must not
80
- /// treat it as rigid.
81
- ForLookup ,
82
- /// We can treat projections in the self type as opaque as
83
- /// we separately look up impls for the normalized self type.
84
- NextSolverLookup ,
85
61
}
86
62
87
63
/// Tries to simplify a type by only returning the outermost injective¹ layer, if one exists.
@@ -139,21 +115,17 @@ pub fn simplify_type<'tcx>(
139
115
ty:: FnPtr ( f) => Some ( SimplifiedType :: Function ( f. skip_binder ( ) . inputs ( ) . len ( ) ) ) ,
140
116
ty:: Placeholder ( ..) => Some ( SimplifiedType :: Placeholder ) ,
141
117
ty:: Param ( _) => match treat_params {
142
- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => {
143
- Some ( SimplifiedType :: Placeholder )
144
- }
118
+ TreatParams :: ForLookup => Some ( SimplifiedType :: Placeholder ) ,
145
119
TreatParams :: AsCandidateKey => None ,
146
120
} ,
147
121
ty:: Alias ( ..) => match treat_params {
148
122
// When treating `ty::Param` as a placeholder, projections also
149
123
// don't unify with anything else as long as they are fully normalized.
150
- //
151
- // We will have to be careful with lazy normalization here.
152
- // FIXME(lazy_normalization): This is probably not right...
124
+ // FIXME(-Znext-solver): Can remove this `if` and always simplify to `Placeholder`
125
+ // when the new solver is enabled by default.
153
126
TreatParams :: ForLookup if !ty. has_non_region_infer ( ) => {
154
127
Some ( SimplifiedType :: Placeholder )
155
128
}
156
- TreatParams :: NextSolverLookup => Some ( SimplifiedType :: Placeholder ) ,
157
129
TreatParams :: ForLookup | TreatParams :: AsCandidateKey => None ,
158
130
} ,
159
131
ty:: Foreign ( def_id) => Some ( SimplifiedType :: Foreign ( def_id) ) ,
@@ -331,7 +303,7 @@ impl DeepRejectCtxt {
331
303
// Depending on the value of `treat_obligation_params`, we either
332
304
// treat generic parameters like placeholders or like inference variables.
333
305
ty:: Param ( _) => match self . treat_obligation_params {
334
- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => false ,
306
+ TreatParams :: ForLookup => false ,
335
307
TreatParams :: AsCandidateKey => true ,
336
308
} ,
337
309
@@ -373,7 +345,7 @@ impl DeepRejectCtxt {
373
345
let k = impl_ct. kind ( ) ;
374
346
match obligation_ct. kind ( ) {
375
347
ty:: ConstKind :: Param ( _) => match self . treat_obligation_params {
376
- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => false ,
348
+ TreatParams :: ForLookup => false ,
377
349
TreatParams :: AsCandidateKey => true ,
378
350
} ,
379
351
0 commit comments