@@ -58,30 +58,6 @@ pub enum TreatParams {
5858 /// This also treats projections with inference variables as infer vars
5959 /// since they could be further normalized.
6060 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 ,
8561}
8662
8763/// Tries to simplify a type by only returning the outermost injective¹ layer, if one exists.
@@ -139,21 +115,17 @@ pub fn simplify_type<'tcx>(
139115 ty:: FnPtr ( f) => Some ( SimplifiedType :: Function ( f. skip_binder ( ) . inputs ( ) . len ( ) ) ) ,
140116 ty:: Placeholder ( ..) => Some ( SimplifiedType :: Placeholder ) ,
141117 ty:: Param ( _) => match treat_params {
142- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => {
143- Some ( SimplifiedType :: Placeholder )
144- }
118+ TreatParams :: ForLookup => Some ( SimplifiedType :: Placeholder ) ,
145119 TreatParams :: AsCandidateKey => None ,
146120 } ,
147121 ty:: Alias ( ..) => match treat_params {
148122 // When treating `ty::Param` as a placeholder, projections also
149123 // 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.
153126 TreatParams :: ForLookup if !ty. has_non_region_infer ( ) => {
154127 Some ( SimplifiedType :: Placeholder )
155128 }
156- TreatParams :: NextSolverLookup => Some ( SimplifiedType :: Placeholder ) ,
157129 TreatParams :: ForLookup | TreatParams :: AsCandidateKey => None ,
158130 } ,
159131 ty:: Foreign ( def_id) => Some ( SimplifiedType :: Foreign ( def_id) ) ,
@@ -331,7 +303,7 @@ impl DeepRejectCtxt {
331303 // Depending on the value of `treat_obligation_params`, we either
332304 // treat generic parameters like placeholders or like inference variables.
333305 ty:: Param ( _) => match self . treat_obligation_params {
334- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => false ,
306+ TreatParams :: ForLookup => false ,
335307 TreatParams :: AsCandidateKey => true ,
336308 } ,
337309
@@ -373,7 +345,7 @@ impl DeepRejectCtxt {
373345 let k = impl_ct. kind ( ) ;
374346 match obligation_ct. kind ( ) {
375347 ty:: ConstKind :: Param ( _) => match self . treat_obligation_params {
376- TreatParams :: ForLookup | TreatParams :: NextSolverLookup => false ,
348+ TreatParams :: ForLookup => false ,
377349 TreatParams :: AsCandidateKey => true ,
378350 } ,
379351
0 commit comments