about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNeven Villani <vanille@crans.org>2024-07-12 15:58:59 +0200
committerNeven Villani <vanille@crans.org>2024-07-13 20:39:38 +0200
commitfd81880c9108c4b98839d55fe29884a625f05f02 (patch)
tree5933091d15a70c763188a07a73dc433b3ee56e1e
parent78f6386b623c64160fa3475605c7ebfb065f62bf (diff)
downloadrust-fd81880c9108c4b98839d55fe29884a625f05f02.tar.gz
rust-fd81880c9108c4b98839d55fe29884a625f05f02.zip
Leave a trace of the current suboptimal status of foreign_write
-rw-r--r--src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
index 9c19ae76a2d..8e23257b6c0 100644
--- a/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
+++ b/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
@@ -146,6 +146,12 @@ mod transition {
     /// non-protected interior mutable `Reserved` which stay the same.
     fn foreign_write(state: PermissionPriv, protected: bool) -> Option<PermissionPriv> {
         Some(match state {
+            // FIXME: since the fix related to reservedim_spurious_write, it is now possible
+            // to express these transitions of the state machine without an explicit dependency
+            // on `protected`: because `ty_is_freeze: false` implies `!protected` then
+            // the line handling `Reserved { .. } if protected` could be deleted.
+            // This will however require optimizations to the exhaustive tests because
+            // fewer initial conditions are valid.
             Reserved { .. } if protected => Disabled,
             res @ Reserved { ty_is_freeze: false, .. } => res,
             _ => Disabled,