2022-06-20 03:13:08 +00:00
|
|
|
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
|
2022-06-20 03:13:08 +00:00
|
|
|
}
|
|
|
|
|
2025-04-30 11:18:21 +00:00
|
|
|
const fn format_args() {
|
|
|
|
format_args!("{}", 0);
|
|
|
|
//~^ ERROR cannot call non-const formatting macro in constant functions
|
|
|
|
}
|
|
|
|
|
2022-06-20 03:13:08 +00:00
|
|
|
fn main() {}
|