]>
Commit | Line | Data |
---|---|---|
54a0048b SL |
1 | #![deny(const_err)] |
2 | ||
fc512014 | 3 | pub const A: i8 = -i8::MIN; //~ ERROR const_err |
5869c6ff | 4 | //~| WARN this was previously accepted by the compiler but is being phased out |
0531ce1d | 5 | pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err |
5869c6ff | 6 | //~| WARN this was previously accepted by the compiler but is being phased out |
0531ce1d | 7 | pub const C: u8 = 200u8 * 4; //~ ERROR const_err |
5869c6ff | 8 | //~| WARN this was previously accepted by the compiler but is being phased out |
0531ce1d | 9 | pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err |
5869c6ff | 10 | //~| WARN this was previously accepted by the compiler but is being phased out |
94b46f34 | 11 | pub const E: u8 = [5u8][1]; //~ ERROR const_err |
5869c6ff | 12 | //~| WARN this was previously accepted by the compiler but is being phased out |
54a0048b SL |
13 | |
14 | fn main() { | |
0531ce1d XL |
15 | let _a = A; |
16 | let _b = B; | |
17 | let _c = C; | |
18 | let _d = D; | |
19 | let _e = E; | |
3157f602 | 20 | let _e = [6u8][1]; |
54a0048b | 21 | } |