]> git.lizzy.rs Git - rust.git/commitdiff
Reorder yield visitation order to match call
authorJonas Schievink <jonasschievink@gmail.com>
Mon, 17 Feb 2020 20:20:48 +0000 (21:20 +0100)
committerJonas Schievink <jonasschievink@gmail.com>
Wed, 19 Feb 2020 22:19:15 +0000 (23:19 +0100)
src/librustc/mir/visit.rs
src/librustc_mir/dataflow/move_paths/builder.rs

index 8330bbe0834326b2844d49aec5dbf5509e86cf16..409c981801b34aa329bd69ad28009b4b4dbfddb8 100644 (file)
@@ -519,12 +519,12 @@ fn super_terminator_kind(&mut self,
                         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);
                     }
 
                 }
index 6f8caca5e21ef1125ee66f2dfd25b798ac2f7542..57aa5de7f7a318de09ab76bf2534e5f572ea601f 100644 (file)
@@ -381,9 +381,9 @@ fn gather_terminator(&mut self, term: &Terminator<'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: _ } => {