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: _ } => {