Confusing diagnostic when using format strings in const fn
#93665
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Reproduced in the Playground on 1.58.1 stable.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fe56b4c08a046bd087207e0649379a33
The current output is:
panic
with formatting isn't fully supported in const contexts, but the diagnostic is surprising, since it's not obvious that there are any function pointer casts happening. This should give a more direct message about what I've done wrong.The text was updated successfully, but these errors were encountered: