@@ -99,7 +99,10 @@ impl<'tcx> InferCtxt<'tcx> {
9999 // `?1 <: ?3`.
100100 let Generalization { value_may_be_infer : generalized_ty } = self . generalize (
101101 relation. span ( ) ,
102- relation. structurally_relate_aliases ( ) . into ( ) ,
102+ match relation. structurally_relate_aliases ( ) {
103+ StructurallyRelateAliases :: No => GeneralizerState :: Default ,
104+ StructurallyRelateAliases :: Yes => GeneralizerState :: StructurallyRelateAliases ,
105+ } ,
103106 target_vid,
104107 instantiation_variance,
105108 source_ty,
@@ -236,7 +239,10 @@ impl<'tcx> InferCtxt<'tcx> {
236239 // constants and generic expressions are not yet handled correctly.
237240 let Generalization { value_may_be_infer : generalized_ct } = self . generalize (
238241 relation. span ( ) ,
239- relation. structurally_relate_aliases ( ) . into ( ) ,
242+ match relation. structurally_relate_aliases ( ) {
243+ StructurallyRelateAliases :: No => GeneralizerState :: Default ,
244+ StructurallyRelateAliases :: Yes => GeneralizerState :: StructurallyRelateAliases ,
245+ } ,
240246 target_vid,
241247 ty:: Invariant ,
242248 source_ct,
@@ -359,15 +365,6 @@ enum GeneralizerState {
359365 StructurallyRelateAliases ,
360366}
361367
362- impl From < StructurallyRelateAliases > for GeneralizerState {
363- fn from ( structurally_relate_aliases : StructurallyRelateAliases ) -> Self {
364- match structurally_relate_aliases {
365- StructurallyRelateAliases :: No => GeneralizerState :: Default ,
366- StructurallyRelateAliases :: Yes => GeneralizerState :: StructurallyRelateAliases ,
367- }
368- }
369- }
370-
371368/// The "generalizer" is used when handling inference variables.
372369///
373370/// The basic strategy for handling a constraint like `?A <: B` is to
0 commit comments