summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/const_panic_track_caller.rs
blob: 9cf7a3ba7dc1cfb74b903954b3a14cef0dea7ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![allow(non_fmt_panics)]
#![crate_type = "lib"]

#[track_caller]
const fn a() -> u32 {
    panic!("hey")
}

#[track_caller]
const fn b() -> u32 {
    a()
}

const fn c() -> u32 {
    b()
    //~^ ERROR evaluation of constant value failed
    //~| NOTE the evaluated program panicked
    //~| NOTE inside
}

const X: u32 = c();
//~^ NOTE inside