about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/stacked-borrows/stacked-borrows.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/tools/miri/tests/pass/stacked-borrows/stacked-borrows.rs b/src/tools/miri/tests/pass/stacked-borrows/stacked-borrows.rs
index 43ba490d5bb..c75824d7f9b 100644
--- a/src/tools/miri/tests/pass/stacked-borrows/stacked-borrows.rs
+++ b/src/tools/miri/tests/pass/stacked-borrows/stacked-borrows.rs
@@ -265,13 +265,15 @@ fn write_does_not_invalidate_all_aliases() {
     assert_eq!(*x, 1337); // oops, the value changed! I guess not all pointers were invalidated
 }
 
-fn box_into_raw_allows_interior_mutable_alias() { unsafe {
-    let b = Box::new(std::cell::Cell::new(42));
-    let raw = Box::into_raw(b);
-    let c = &*raw;
-    let d = raw.cast::<i32>(); // bypassing `Cell` -- only okay in Miri tests
-    // `c` and `d` should permit arbitrary aliasing with each other now.
-    *d = 1;
-    c.set(2);
-    drop(Box::from_raw(raw));
-} }
+fn box_into_raw_allows_interior_mutable_alias() {
+    unsafe {
+        let b = Box::new(std::cell::Cell::new(42));
+        let raw = Box::into_raw(b);
+        let c = &*raw;
+        let d = raw.cast::<i32>(); // bypassing `Cell` -- only okay in Miri tests
+        // `c` and `d` should permit arbitrary aliasing with each other now.
+        *d = 1;
+        c.set(2);
+        drop(Box::from_raw(raw));
+    }
+}