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 1357de4 + 18f14e2 commit 2b4c34dCopy full SHA for 2b4c34d
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