summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs-enums/enum-discrim-range-overflow.rs
blob: 9c4c61e684b9c0f95841b6a665b9e4d3bd61123c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// run-pass
#![allow(overflowing_literals)]

// pretty-expanded FIXME #23616

pub enum E64 {
    H64 = 0x7FFF_FFFF_FFFF_FFFF,
    L64 = 0x8000_0000_0000_0000
}
pub enum E32 {
    H32 = 0x7FFF_FFFF,
    L32 = 0x8000_0000
}

pub fn f(e64: E64, e32: E32) -> (bool,bool) {
    (match e64 {
        E64::H64 => true,
        E64::L64 => false
    },
     match e32 {
        E32::H32 => true,
        E32::L32 => false
    })
}

pub fn main() { }