make matches exhaustive
This commit is contained in:
parent
ec61761e46
commit
f7dcdcc0b9
1 changed files with 14 additions and 6 deletions
|
|
@ -2462,11 +2462,15 @@ impl<'tcx> TypeFoldable<'tcx> for UserTypeProjection {
|
|||
let projs: Vec<_> = self
|
||||
.projs
|
||||
.iter()
|
||||
.map(|elem| match elem {
|
||||
.map(|&elem| match elem {
|
||||
Deref => Deref,
|
||||
Field(f, ()) => Field(*f, ()),
|
||||
Field(f, ()) => Field(f, ()),
|
||||
Index(()) => Index(()),
|
||||
elem => *elem,
|
||||
Downcast(symbol, variantidx) => Downcast(symbol, variantidx),
|
||||
ConstantIndex { offset, min_length, from_end } => {
|
||||
ConstantIndex { offset, min_length, from_end }
|
||||
}
|
||||
Subslice { from, to, from_end } => Subslice { from, to, from_end },
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
|
@ -2862,11 +2866,15 @@ impl<'tcx> TypeFoldable<'tcx> for PlaceElem<'tcx> {
|
|||
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
|
||||
use crate::mir::ProjectionElem::*;
|
||||
|
||||
match self {
|
||||
match *self {
|
||||
Deref => Deref,
|
||||
Field(f, ty) => Field(*f, ty.fold_with(folder)),
|
||||
Field(f, ty) => Field(f, ty.fold_with(folder)),
|
||||
Index(v) => Index(v.fold_with(folder)),
|
||||
elem => *elem,
|
||||
Downcast(symbol, variantidx) => Downcast(symbol, variantidx),
|
||||
ConstantIndex { offset, min_length, from_end } => {
|
||||
ConstantIndex { offset, min_length, from_end }
|
||||
}
|
||||
Subslice { from, to, from_end } => Subslice { from, to, from_end },
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue