The 2021 panic macro no longer works in const
functions
#87466
Labels
A-const-fn
Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.
A-edition-2021
Area: The 2021 edition
A-error-handling
Area: Error handling
requires-nightly
This issue requires a nightly compiler in some way.
I encountered one issue when trying to migrate my crates to edition 2021. This no longer compiles:
I understand that this requires a nightly feature to observe, but
const_panic
was really close to stabilizing and I use this in a lot of places. Is it possible to adjust the underlyingformat_args
to beconst
with a static string input, or is there something else I should use? I don't want to go back to using the weird out-of-bounds indexing hack when trying to convey messages from aconst
function.The text was updated successfully, but these errors were encountered: