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