rust/tests/ui/consts/const-err-multi.rs
Ralf Jung 17946c22b1 const-eval error: always say in which item the error occurred
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-07 13:42:30 +02:00

14 lines
313 B
Rust

pub const A: i8 = -i8::MIN;
//~^ NOTE failed here
//~| ERROR attempt to negate `i8::MIN`, which would overflow
pub const B: i8 = A;
//~^ NOTE erroneous constant
pub const C: u8 = A as u8;
//~^ NOTE erroneous constant
pub const D: i8 = 50 - A;
//~^ NOTE erroneous constant
fn main() {
let _ = (A, B, C, D);
}