summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/non-const-value-in-const.rs
blob: 1a20b1e09d7be67f80b56b9b3156bce3e197db74 (plain)
1
2
3
4
5
6
7
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]
}