From 71c4f76153590fc1744c7f73b94d2d39ae2e2f23 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 Feb 2020 21:20:48 +0100 Subject: [PATCH] Reorder yield visitation order to match call --- src/librustc/mir/visit.rs | 2 +- src/librustc_mir/dataflow/move_paths/builder.rs | 2 +- 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 @@ 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); } } 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 @@ 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: _ } => { -- 2.44.0