rust/src/test/ui/consts/const-err-early.rs

17 lines
399 B
Rust
Raw Normal View History

#![deny(const_err)]
2018-04-20 07:18:29 -05:00
pub const A: i8 = -std::i8::MIN; //~ ERROR const_err
pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err
pub const C: u8 = 200u8 * 4; //~ ERROR const_err
pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err
2018-06-03 16:39:02 -05:00
pub const E: u8 = [5u8][1]; //~ ERROR const_err
fn main() {
2018-01-29 13:47:09 -06:00
let _a = A;
let _b = B;
let _c = C;
let _d = D;
let _e = E;
let _e = [6u8][1];
}