about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/instcombine.rs
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
commit09b0936db2bb3be67451c6f8948e90987e764f81 (patch)
tree33c3a24a12791982173c389fabd5d317223beb9a /compiler/rustc_mir_transform/src/instcombine.rs
parent222c5724ecc922fe67815f428c19f82c129d9386 (diff)
downloadrust-09b0936db2bb3be67451c6f8948e90987e764f81.tar.gz
rust-09b0936db2bb3be67451c6f8948e90987e764f81.zip
Refactor call terminator to always hold a destination place
Diffstat (limited to 'compiler/rustc_mir_transform/src/instcombine.rs')
-rw-r--r--compiler/rustc_mir_transform/src/instcombine.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/instcombine.rs b/compiler/rustc_mir_transform/src/instcombine.rs
index 268ce1b2e8c..4fbb7643378 100644
--- a/compiler/rustc_mir_transform/src/instcombine.rs
+++ b/compiler/rustc_mir_transform/src/instcombine.rs
@@ -141,7 +141,7 @@ impl<'tcx> InstCombineContext<'tcx, '_> {
         terminator: &mut Terminator<'tcx>,
         statements: &mut Vec<Statement<'tcx>>,
     ) {
-        let TerminatorKind::Call { func, args, destination, .. } = &mut terminator.kind
+        let TerminatorKind::Call { func, args, destination, target, .. } = &mut terminator.kind
         else { return };
 
         // It's definitely not a clone if there are multiple arguments
@@ -149,7 +149,7 @@ impl<'tcx> InstCombineContext<'tcx, '_> {
             return;
         }
 
-        let Some((destination_place, destination_block)) = *destination
+        let Some(destination_block) = *target
         else { return };
 
         // Only bother looking more if it's easy to know what we're calling
@@ -193,7 +193,7 @@ impl<'tcx> InstCombineContext<'tcx, '_> {
         statements.push(Statement {
             source_info: terminator.source_info,
             kind: StatementKind::Assign(Box::new((
-                destination_place,
+                *destination,
                 Rvalue::Use(Operand::Copy(
                     arg_place.project_deeper(&[ProjectionElem::Deref], self.tcx),
                 )),