mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
92cc57bafc
`repr(transparent)` now silences the lint.
13 lines
180 B
Rust
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);
|
|
}
|