We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eb7bf6e + 6f8fb3c commit 9f35309Copy full SHA for 9f35309
src/tools/miri/tests/pass/tree_borrows/sb_fails.rs
@@ -67,10 +67,11 @@ mod static_memory_modification {
67
68
#[allow(mutable_transmutes)]
69
pub fn main() {
70
- let _x = unsafe {
+ let x = unsafe {
71
std::mem::transmute::<&usize, &mut usize>(&X) // In SB this mutable reborrow fails.
72
// But in TB we are allowed to transmute as long as we don't write.
73
};
74
+ assert_eq!(*&*x, 5);
75
}
76
77
0 commit comments