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 // Issue 23030: Workaround overflowing discriminant
12 // with explicit assignments.
14 // See also compile-fail/overflow-discrim.rs, which shows what
15 // happens if you leave the OhNo explicit cases out here.
17 use std::{i8,u8,i16,u16,i32,u32,i64,u64,isize,usize};
29 let _x = (A::Ok, A::Ok2, A::OhNo);
30 let z = (A::NotTheEnd, A::Zero).1 as i8;
42 let _x = (A::Ok, A::Ok2, A::OhNo);
55 let _x = (A::Ok, A::Ok2, A::OhNo);
56 let z = (A::NotTheEnd, A::Zero).1 as i16;
68 let _x = (A::Ok, A::Ok2, A::OhNo);
81 let _x = (A::Ok, A::Ok2, A::OhNo);
82 let z = (A::NotTheEnd, A::Zero).1 as i32;
94 let _x = (A::Ok, A::Ok2, A::OhNo);
107 let _x = (A::Ok, A::Ok2, A::OhNo);
108 let z = (A::NotTheEnd, A::Zero).1 as i64;
120 let _x = (A::Ok, A::Ok2, A::OhNo);
133 let _x = (A::Ok, A::Ok2, A::OhNo);
134 let z = (A::NotTheEnd, A::Zero).1 as isize;
146 let _x = (A::Ok, A::Ok2, A::OhNo);
155 f_isize(); f_usize();