]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-prop-overflowing-casts.rs
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
[rust.git] / src / test / ui / consts / const-prop-overflowing-casts.rs
1 // check-pass
2
3 enum Foo {
4     Bar = -42,
5     Baz = 42,
6 }
7
8 fn main() {
9     let _ = 0u8 as u32;
10     let _ = (1u32 << 31) as u16;
11     let _ = (1u16 << 15) as u8;
12     let _ = (!0u16) as u8;
13     let _ = (-1i16) as i8;
14     let _ = (Foo::Bar) as i8;
15 }