mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
11 lines
326 B
Rust
11 lines
326 B
Rust
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
|
|
// despite $LINT being allowed on command line
|
|
//@ compile-flags: -A mutable_transmutes --force-warn mutable_transmutes
|
|
//@ check-pass
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
|
|
}
|
|
}
|