summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/const_panic_stability.rs
blob: 1aee6f27e2752384be92aa767d8ab27332b1553e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// revisions: e2018 e2021
//[e2018] edition:2018
//[e2021] edition:2021
//[e2018] check-pass
#![crate_type = "lib"]
#![stable(feature = "foo", since = "1.0.0")]
#![feature(staged_api)]

#[stable(feature = "foo", since = "1.0.0")]
#[rustc_const_stable(feature = "foo", since = "1.0.0")]
const fn foo() {
    assert!(false);
    assert!(false, "foo");
    panic!({ "foo" });
    //[e2018]~^ WARNING panic message is not a string literal
    //[e2021]~^^ ERROR format argument must be a string literal
}