mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-14 16:03:17 +00:00
![Mara Bos](/assets/img/avatar_default.png)
panic!("a {}", "b") is still not allowed in const, even if the hir flattens to panic!("a b").
15 lines
506 B
Rust
15 lines
506 B
Rust
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() {}
|