-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
"Consider adding a semicolon here" for a closure without block #97359
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=cc081036ff00b0844aac10d9fdac636f
The current output is:
Ideally rustc should suggest adding a semicolon (and a block):
It already does that if we have a block https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=433c9f8d9638e927fe4f5ba66d5551fa:
@rustbot label +A-suggestion-diagnostics
@rustbot claim
Noticed by this StackOverflow question.