Skip to content

Commit 25e5ac4

Browse files
Disable tree traversal optimization that is wrong due to lazy nodes.
See rust-lang#3846 for more information.
1 parent 2f13379 commit 25e5ac4

File tree

1 file changed

+5
-5
lines changed
  • src/tools/miri/src/borrow_tracker/tree_borrows

1 file changed

+5
-5
lines changed

src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ impl LocationState {
150150
// the propagation can be skipped next time.
151151
// It is a performance loss not to call this function when a foreign access occurs.
152152
// It is unsound not to call this function when a child access occurs.
153-
fn skip_if_known_noop(
153+
// FIXME: This optimization is wrong, and is currently disabled (by ignoring the
154+
// result returned here). Since we presumably want an optimization like this,
155+
// we should add it back. See #3864 for more information.
156+
fn update_last_foreign_access(
154157
&mut self,
155158
access_kind: AccessKind,
156159
rel_pos: AccessRelatedness,
@@ -613,10 +616,7 @@ impl<'tcx> Tree {
613616

614617
let old_state = perm.or_insert(LocationState::new_uninit(node.default_initial_perm));
615618

616-
match old_state.skip_if_known_noop(access_kind, rel_pos) {
617-
ContinueTraversal::SkipChildren => return Ok(ContinueTraversal::SkipChildren),
618-
_ => {}
619-
}
619+
old_state.update_last_foreign_access(access_kind, rel_pos);
620620

621621
let protected = global.borrow().protected_tags.contains_key(&node.tag);
622622
let transition = old_state.perform_access(access_kind, rel_pos, protected)?;

0 commit comments

Comments
 (0)