Remove redundant checks.
This commit is contained in:
parent
7ae1851803
commit
abb723dea2
1 changed files with 2 additions and 16 deletions
|
@ -1693,10 +1693,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
self.move_errors.push(MoveError::new(
|
self.move_errors.push(MoveError::new(
|
||||||
place,
|
place,
|
||||||
location,
|
location,
|
||||||
InteriorOfSliceOrArray {
|
InteriorOfSliceOrArray { ty: place_ty.ty, is_index: false },
|
||||||
ty: place_ty.ty,
|
|
||||||
is_index: matches!(elem, ProjectionElem::Index(..)),
|
|
||||||
},
|
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1705,7 +1702,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProjectionElem::Index(_) => match place_ty.ty.kind() {
|
ProjectionElem::Index(_) => match place_ty.ty.kind() {
|
||||||
ty::Array(..) => {
|
ty::Array(..) | ty::Slice(..) => {
|
||||||
self.move_errors.push(MoveError::new(
|
self.move_errors.push(MoveError::new(
|
||||||
place,
|
place,
|
||||||
location,
|
location,
|
||||||
|
@ -1713,17 +1710,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ty::Slice(_) => {
|
|
||||||
self.move_errors.push(MoveError::new(
|
|
||||||
place,
|
|
||||||
location,
|
|
||||||
InteriorOfSliceOrArray {
|
|
||||||
ty: place_ty.ty,
|
|
||||||
is_index: matches!(elem, ProjectionElem::Index(..)),
|
|
||||||
},
|
|
||||||
));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_ => bug!("Unexpected type {place_ty:#?}"),
|
_ => bug!("Unexpected type {place_ty:#?}"),
|
||||||
},
|
},
|
||||||
// `OpaqueCast`: only transmutes the type, so no moves there.
|
// `OpaqueCast`: only transmutes the type, so no moves there.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue