rust/tests/ui/consts/const-eval/format.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
506 B
Rust
Raw Normal View History

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() {}