about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-04-16 09:27:54 -0400
committerJakob Degen <jakob.e.degen@gmail.com>2022-05-23 17:49:04 -0400
commit0684d62b564c2e88bd812fccf00d35bcd2554cb6 (patch)
treee984e0d6655bab9e6f22431ff9d4f9ba54ff1f93
parent77d2b100509646a26435d69f97aee7d031a0aa37 (diff)
downloadrust-0684d62b564c2e88bd812fccf00d35bcd2554cb6.tar.gz
rust-0684d62b564c2e88bd812fccf00d35bcd2554cb6.zip
Refactor call terminator to always hold a destination place
-rw-r--r--clippy_lints/src/redundant_clone.rs4
-rw-r--r--clippy_utils/src/qualify_min_const_fn.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs
index 0004b8afdd3..ab16fe47d4d 100644
--- a/clippy_lints/src/redundant_clone.rs
+++ b/clippy_lints/src/redundant_clone.rs
@@ -292,7 +292,7 @@ fn is_call_with_ref_arg<'tcx>(
         if let (inner_ty, 1) = walk_ptrs_ty_depth(args[0].ty(&*mir, cx.tcx));
         if !is_copy(cx, inner_ty);
         then {
-            Some((def_id, *local, inner_ty, destination.as_ref().map(|(dest, _)| dest)?.as_local()?))
+            Some((def_id, *local, inner_ty, destination.as_local()?))
         } else {
             None
         }
@@ -584,7 +584,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
     fn visit_terminator(&mut self, terminator: &mir::Terminator<'_>, _loc: mir::Location) {
         if let mir::TerminatorKind::Call {
             args,
-            destination: Some((mir::Place { local: dest, .. }, _)),
+            destination: mir::Place { local: dest, .. },
             ..
         } = &terminator.kind
         {
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs
index a6d7042fabc..78d8f1e213a 100644
--- a/clippy_utils/src/qualify_min_const_fn.rs
+++ b/clippy_utils/src/qualify_min_const_fn.rs
@@ -301,6 +301,7 @@ fn check_terminator<'a, 'tcx>(
             args,
             from_hir_call: _,
             destination: _,
+            target: _,
             cleanup: _,
             fn_span: _,
         } => {