mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
16 lines
263 B
Rust
16 lines
263 B
Rust
// A quick test of 'unsafe const fn' functionality
|
|
|
|
// revisions: mir thir
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
|
|
|
const unsafe fn dummy(v: u32) -> u32 {
|
|
!v
|
|
}
|
|
|
|
const VAL: u32 = dummy(0xFFFF);
|
|
//~^ ERROR E0133
|
|
|
|
fn main() {
|
|
assert_eq!(VAL, 0xFFFF0000);
|
|
}
|