rust/tests/ui/lint/force-warn/deny-by-default-lint.rs
2023-01-11 09:32:08 +00:00

10 lines
255 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
}
}