mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
10 lines
257 B
Rust
10 lines
257 B
Rust
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
|
|
//@ compile-flags: --force-warn mutable_transmutes
|
|
//@ check-pass
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
|
|
}
|
|
}
|