rust/tests/ui/consts/non-const-value-in-const.rs
2023-01-11 09:32:08 +00:00

7 lines
223 B
Rust

fn main() {
let x = 5;
const Y: i32 = x; //~ ERROR attempt to use a non-constant value in a constant [E0435]
let x = 5;
let _ = [0; x]; //~ ERROR attempt to use a non-constant value in a constant [E0435]
}