about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/sb_fails.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/tree_borrows/sb_fails.rs b/src/tools/miri/tests/pass/tree_borrows/sb_fails.rs
index 1bae30bde60..7da20e76229 100644
--- a/src/tools/miri/tests/pass/tree_borrows/sb_fails.rs
+++ b/src/tools/miri/tests/pass/tree_borrows/sb_fails.rs
@@ -67,10 +67,11 @@ mod static_memory_modification {
 
     #[allow(mutable_transmutes)]
     pub fn main() {
-        let _x = unsafe {
+        let x = unsafe {
             std::mem::transmute::<&usize, &mut usize>(&X) // In SB this mutable reborrow fails.
             // But in TB we are allowed to transmute as long as we don't write.
         };
+        assert_eq!(*&*x, 5);
     }
 }