Skip to content

Commit 0684d62

Browse files
committed
Refactor call terminator to always hold a destination place
1 parent 77d2b10 commit 0684d62

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clippy_lints/src/redundant_clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn is_call_with_ref_arg<'tcx>(
292292
if let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].ty(&*mir, cx.tcx));
293293
if !is_copy(cx, inner_ty);
294294
then {
295-
Some((def_id, *local, inner_ty, destination.as_ref().map(|(dest, _)| dest)?.as_local()?))
295+
Some((def_id, *local, inner_ty, destination.as_local()?))
296296
} else {
297297
None
298298
}
@@ -584,7 +584,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
584584
fn visit_terminator(&mut self, terminator: &mir::Terminator<'_>, _loc: mir::Location) {
585585
if let mir::TerminatorKind::Call {
586586
args,
587-
destination: Some((mir::Place { local: dest, .. }, _)),
587+
destination: mir::Place { local: dest, .. },
588588
..
589589
} = &terminator.kind
590590
{

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ fn check_terminator<'a, 'tcx>(
301301
args,
302302
from_hir_call: _,
303303
destination: _,
304+
target: _,
304305
cleanup: _,
305306
fn_span: _,
306307
} => {

0 commit comments

Comments
 (0)