-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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.This issue requires a nightly compiler in some way.
Description
I encountered one issue when trying to migrate my crates to edition 2021. This no longer compiles:
#![feature(const_panic)]
pub const fn f() {
panic!("important info");
}
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 underlying format_args
to be const
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 a const
function.
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.This issue requires a nightly compiler in some way.