1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-tidy-linelength
13 // Issue 23030: Detect overflowing discriminant
15 // Check that we detect the overflow even if enum is not used.
17 // See also run-pass/discrim-explicit-23030.rs where the suggested
18 // workaround is tested.
20 use std::{i8,u8,i16,u16,i32,u32,i64, u64};
27 OhNo, //~ ERROR enum discriminant overflowed [E0370]
36 OhNo, //~ ERROR enum discriminant overflowed [E0370]
45 OhNo, //~ ERROR enum discriminant overflowed [E0370]
54 OhNo, //~ ERROR enum discriminant overflowed [E0370]
63 OhNo, //~ ERROR enum discriminant overflowed [E0370]
72 OhNo, //~ ERROR enum discriminant overflowed [E0370]
81 OhNo, //~ ERROR enum discriminant overflowed [E0370]
90 OhNo, //~ ERROR enum discriminant overflowed [E0370]