@@ -2462,11 +2462,15 @@ impl<'tcx> TypeFoldable<'tcx> for UserTypeProjection {
2462
2462
let projs: Vec < _ > = self
2463
2463
. projs
2464
2464
. iter ( )
2465
- . map ( |elem| match elem {
2465
+ . map ( |& elem| match elem {
2466
2466
Deref => Deref ,
2467
- Field ( f, ( ) ) => Field ( * f, ( ) ) ,
2467
+ Field ( f, ( ) ) => Field ( f, ( ) ) ,
2468
2468
Index ( ( ) ) => Index ( ( ) ) ,
2469
- elem => * elem,
2469
+ Downcast ( symbol, variantidx) => Downcast ( symbol, variantidx) ,
2470
+ ConstantIndex { offset, min_length, from_end } => {
2471
+ ConstantIndex { offset, min_length, from_end }
2472
+ }
2473
+ Subslice { from, to, from_end } => Subslice { from, to, from_end } ,
2470
2474
} )
2471
2475
. collect ( ) ;
2472
2476
@@ -2862,11 +2866,15 @@ impl<'tcx> TypeFoldable<'tcx> for PlaceElem<'tcx> {
2862
2866
fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
2863
2867
use crate :: mir:: ProjectionElem :: * ;
2864
2868
2865
- match self {
2869
+ match * self {
2866
2870
Deref => Deref ,
2867
- Field ( f, ty) => Field ( * f, ty. fold_with ( folder) ) ,
2871
+ Field ( f, ty) => Field ( f, ty. fold_with ( folder) ) ,
2868
2872
Index ( v) => Index ( v. fold_with ( folder) ) ,
2869
- elem => * elem,
2873
+ Downcast ( symbol, variantidx) => Downcast ( symbol, variantidx) ,
2874
+ ConstantIndex { offset, min_length, from_end } => {
2875
+ ConstantIndex { offset, min_length, from_end }
2876
+ }
2877
+ Subslice { from, to, from_end } => Subslice { from, to, from_end } ,
2870
2878
}
2871
2879
}
2872
2880
0 commit comments