mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 23:03:06 +03:00
18 lines
476 B
Rust
18 lines
476 B
Rust
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
|
|
//~| ERROR cannot call non-const function `std::io::_print` in constant functions
|
|
}
|
|
|
|
const fn format_args() {
|
|
format_args!("{}", 0);
|
|
//~^ ERROR cannot call non-const formatting macro in constant functions
|
|
}
|
|
|
|
fn main() {}
|