about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-02-17 21:20:48 +0100
committerJonas Schievink <jonasschievink@gmail.com>2020-02-19 23:19:15 +0100
commit71c4f76153590fc1744c7f73b94d2d39ae2e2f23 (patch)
tree6f82dcffb1febb85fb07cfee934c371b319d5716
parentd4c6dfe6d6028dacc0dc59f509a823aad2d2cdf6 (diff)
downloadrust-71c4f76153590fc1744c7f73b94d2d39ae2e2f23.tar.gz
rust-71c4f76153590fc1744c7f73b94d2d39ae2e2f23.zip
Reorder yield visitation order to match call
-rw-r--r--src/librustc/mir/visit.rs2
-rw-r--r--src/librustc_mir/dataflow/move_paths/builder.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs
index 8330bbe0834..409c981801b 100644
--- a/src/librustc/mir/visit.rs
+++ b/src/librustc/mir/visit.rs
@@ -519,12 +519,12 @@ macro_rules! make_mir_visitor {
                         resume_arg,
                         drop: _,
                     } => {
+                        self.visit_operand(value, source_location);
                         self.visit_place(
                             resume_arg,
                             PlaceContext::MutatingUse(MutatingUseContext::Store),
                             source_location,
                         );
-                        self.visit_operand(value, source_location);
                     }
 
                 }
diff --git a/src/librustc_mir/dataflow/move_paths/builder.rs b/src/librustc_mir/dataflow/move_paths/builder.rs
index 6f8caca5e21..57aa5de7f7a 100644
--- a/src/librustc_mir/dataflow/move_paths/builder.rs
+++ b/src/librustc_mir/dataflow/move_paths/builder.rs
@@ -381,9 +381,9 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
             }
 
             TerminatorKind::Yield { ref value, resume_arg: ref place, .. } => {
+                self.gather_operand(value);
                 self.create_move_path(place);
                 self.gather_init(place.as_ref(), InitKind::Deep);
-                self.gather_operand(value);
             }
 
             TerminatorKind::Drop { ref location, target: _, unwind: _ } => {