2015-10-03 10:42:22 -05:00
|
|
|
// A quick test of 'unsafe const fn' functionality
|
|
|
|
|
2021-03-14 14:11:37 -05:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
|
|
|
|
2015-10-24 03:52:07 -05:00
|
|
|
const unsafe fn dummy(v: u32) -> u32 {
|
2015-10-03 10:42:22 -05:00
|
|
|
!v
|
|
|
|
}
|
|
|
|
|
2016-08-10 02:29:45 -05:00
|
|
|
const VAL: u32 = dummy(0xFFFF);
|
|
|
|
//~^ ERROR E0133
|
2015-10-03 10:42:22 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(VAL, 0xFFFF0000);
|
|
|
|
}
|