summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/const_panic_track_caller.rs
blob: 799a59d16ca2fed63c182e5d1969c0e85d9e5bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![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() //~ NOTE inside `c`
    //~^ NOTE the failure occurred here
}

const X: u32 = c();
//~^ ERROR evaluation of constant value failed
//~| NOTE hey