-
-
Notifications
You must be signed in to change notification settings - Fork 15k
non_fmt_panics suggestion breaks for some const functions #88429
Copy link
Copy link
Closed
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.
Metadata
Metadata
Assignees
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
This provides a suggestion to replace the code with:
However, this will not compile in a const function:
I'm not actually sure what the correct suggestion should be, since
panic_anyis not const.Found during the 2021 crater run for:
Meta
rustc --version --verbose: