]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-err-early.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / consts / const-err-early.rs
CommitLineData
54a0048b
SL
1#![deny(const_err)]
2
fc512014 3pub const A: i8 = -i8::MIN; //~ ERROR const_err
5869c6ff 4//~| WARN this was previously accepted by the compiler but is being phased out
0531ce1d 5pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err
5869c6ff 6//~| WARN this was previously accepted by the compiler but is being phased out
0531ce1d 7pub const C: u8 = 200u8 * 4; //~ ERROR const_err
5869c6ff 8//~| WARN this was previously accepted by the compiler but is being phased out
0531ce1d 9pub 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 11pub 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
14fn 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}