2021-03-31 03:09:16 -05:00
|
|
|
// stderr-per-bitwidth
|
2018-07-02 12:00:07 -05:00
|
|
|
|
2018-05-24 04:03:33 -05:00
|
|
|
fn main() {
|
2018-05-25 08:13:54 -05:00
|
|
|
let n: Int = 40;
|
|
|
|
match n {
|
2018-05-28 21:42:11 -05:00
|
|
|
0..=10 => {},
|
2018-09-04 05:26:21 -05:00
|
|
|
10..=BAR => {}, //~ ERROR could not evaluate constant pattern
|
2018-05-24 04:03:33 -05:00
|
|
|
_ => {},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-30 02:35:02 -05:00
|
|
|
#[repr(C)]
|
2018-05-24 04:03:33 -05:00
|
|
|
union Foo {
|
|
|
|
f: Int,
|
|
|
|
r: &'static u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(target_pointer_width="64")]
|
|
|
|
type Int = u64;
|
|
|
|
|
|
|
|
#[cfg(target_pointer_width="32")]
|
|
|
|
type Int = u32;
|
|
|
|
|
2022-06-02 19:30:29 -05:00
|
|
|
const BAR: Int = unsafe { Foo { r: &42 }.f };
|
2022-09-21 06:05:20 -05:00
|
|
|
//~^ ERROR constant
|