rust/tests/ui/lint/force-warn/allowed-deny-by-default-lint.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
326 B
Rust
Raw Normal View History

2021-08-18 11:05:59 +02:00
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
// despite $LINT being allowed in module
2022-09-21 13:05:20 +02:00
// compile-flags: --force-warn mutable_transmutes
2021-05-27 19:19:39 +02:00
// check-pass
2022-09-21 13:05:20 +02:00
#![allow(mutable_transmutes)]
fn main() {
unsafe {
let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
}
}