]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-prop-overflowing-casts.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[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 }