summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/format.rs
blob: 5bdb2bf19543907e9f563257b3ec0096345f5342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const fn failure() {
    panic!("{:?}", 0);
    //~^ ERROR cannot call non-const formatting macro in constant functions
    //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
}

const fn print() {
    println!("{:?}", 0);
    //~^ ERROR cannot call non-const formatting macro in constant functions
    //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
    //~| ERROR cannot call non-const fn `_print` in constant functions
}

fn main() {}