]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/dataflow/move_paths/builder.rs
Reorder yield visitation order to match call
[rust.git] / src / librustc_mir / dataflow / move_paths / builder.rs
index 62af196174fd7b91e93d4bff86719385ae0183aa..57aa5de7f7a318de09ab76bf2534e5f572ea601f 100644 (file)
@@ -380,8 +380,10 @@ fn gather_terminator(&mut self, term: &Terminator<'tcx>) {
                 self.gather_operand(discr);
             }
 
-            TerminatorKind::Yield { ref value, .. } => {
+            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);
             }
 
             TerminatorKind::Drop { ref location, target: _, unwind: _ } => {