rust/tests/compile-fail-fullmir/stacked_borrows/static_memory_modification.rs
2018-11-16 10:01:54 +01:00

12 lines
284 B
Rust

// FIXME still considering whether we are okay with this not being an error
// ignore-test
static X: usize = 5;
#[allow(mutable_transmutes)]
fn main() {
let _x = unsafe {
std::mem::transmute::<&usize, &mut usize>(&X) //~ ERROR mutable reference with frozen tag
};
}