Confusing message when using unsafe to initialize statics #94077
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
Ideally the output should look like:
It could suggest moving the unsafe block:
Or perhaps this should be valid? It is inside an unsafe block after all.
The text was updated successfully, but these errors were encountered: