-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
The 2021 panic macro no longer works in const functions #87466
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-edition-2021Area: The 2021 editionArea: The 2021 editionA-error-handlingArea: Error handlingArea: Error handlingrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-edition-2021Area: The 2021 editionArea: The 2021 editionA-error-handlingArea: Error handlingArea: Error handlingrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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_panicwas really close to stabilizing and I use this in a lot of places. Is it possible to adjust the underlyingformat_argsto beconstwith 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 aconstfunction.