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.

13 lines
336 B
Rust
Raw Normal View History

const fn failure() {
panic!("{:?}", 0);
//~^ ERROR cannot call non-const formatting macro in constant functions
}
const fn print() {
println!("{:?}", 0);
//~^ ERROR cannot call non-const formatting macro in constant functions
2024-12-23 21:49:48 +00:00
//~| ERROR cannot call non-const function `_print` in constant functions
}
fn main() {}