Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created November 14, 2017 10:31
Show Gist options
  • Save nikomatsakis/a19d21a651a6e56b25ad03111666765a to your computer and use it in GitHub Desktop.
Save nikomatsakis/a19d21a651a6e56b25ad03111666765a to your computer and use it in GitHub Desktop.
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 18607578c0..4e07c9f81f 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -1588,13 +1588,13 @@ impl<'tcx, T> FlowInProgress<T> where T: HasMoveData<'tcx> + BitDenotation<Idx =
let mut initialized = vec![];
let mut push_siblings = false; // don't look at siblings of original `mpi`.
while let Some(mpi) = todo.pop() {
- if self.curr_state.contains(&mpi) {
- initialized.push(mpi);
- }
let move_path = &move_data.move_paths[mpi];
if let Some(child) = move_path.first_child {
todo.push(child);
+ } else if self.curr_state.contains(&mpi) {
+ initialized.push(mpi);
}
+
if push_siblings {
if let Some(sibling) = move_path.next_sibling {
todo.push(sibling);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment