Fix clippy error
This commit is contained in:
parent
532d205218
commit
bf46f78ca7
@ -320,11 +320,11 @@ fn find_stmt_assigns_to<'tcx>(
|
|||||||
|
|
||||||
match (by_ref, &*rvalue) {
|
match (by_ref, &*rvalue) {
|
||||||
(true, mir::Rvalue::Ref(_, _, place)) | (false, mir::Rvalue::Use(mir::Operand::Copy(place))) => {
|
(true, mir::Rvalue::Ref(_, _, place)) | (false, mir::Rvalue::Use(mir::Operand::Copy(place))) => {
|
||||||
base_local_and_movability(cx, mir, *place)
|
Some(base_local_and_movability(cx, mir, *place))
|
||||||
},
|
},
|
||||||
(false, mir::Rvalue::Ref(_, _, place)) => {
|
(false, mir::Rvalue::Ref(_, _, place)) => {
|
||||||
if let [mir::ProjectionElem::Deref] = place.as_ref().projection {
|
if let [mir::ProjectionElem::Deref] = place.as_ref().projection {
|
||||||
base_local_and_movability(cx, mir, *place)
|
Some(base_local_and_movability(cx, mir, *place))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ fn base_local_and_movability<'tcx>(
|
|||||||
cx: &LateContext<'tcx>,
|
cx: &LateContext<'tcx>,
|
||||||
mir: &mir::Body<'tcx>,
|
mir: &mir::Body<'tcx>,
|
||||||
place: mir::Place<'tcx>,
|
place: mir::Place<'tcx>,
|
||||||
) -> Option<(mir::Local, CannotMoveOut)> {
|
) -> (mir::Local, CannotMoveOut) {
|
||||||
use rustc_middle::mir::PlaceRef;
|
use rustc_middle::mir::PlaceRef;
|
||||||
|
|
||||||
// Dereference. You cannot move things out from a borrowed value.
|
// Dereference. You cannot move things out from a borrowed value.
|
||||||
@ -362,7 +362,7 @@ fn base_local_and_movability<'tcx>(
|
|||||||
&& !is_copy(cx, mir::Place::ty_from(local, projection, &mir.local_decls, cx.tcx).ty);
|
&& !is_copy(cx, mir::Place::ty_from(local, projection, &mir.local_decls, cx.tcx).ty);
|
||||||
}
|
}
|
||||||
|
|
||||||
Some((local, deref || field || slice))
|
(local, deref || field || slice)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct LocalUseVisitor {
|
struct LocalUseVisitor {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user