rust/tests/ui/consts/transmute-const.rs
Jake Goulding 92cc57bafc Remove no-longer-needed allow(dead_code) from the tests
`repr(transparent)` now silences the lint.
2024-01-18 13:16:09 -05:00

13 lines
180 B
Rust

// run-pass
use std::mem;
#[repr(transparent)]
struct Foo(u32);
const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
fn main() {
assert_eq!(TRANSMUTED_U32, 3);
}