blob: 8e34e0ae8c74d410533ec059f10370c8ac5c34f4 (
plain)
1
2
3
4
5
6
7
8
|
// Tests that transmuting from &T to &mut T is Undefined Behavior.
use std::mem::transmute;
fn main() {
let _a: &mut u8 = unsafe { transmute(&1u8) };
//~^ ERROR mutating transmuted &mut T from &T may cause undefined behavior
}
|