-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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`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.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.
Description
It suggests
fn foo({ <body> }
when it should suggest
fn foo() { <body> }
or at least suggest
fn foo(){ <body> }
struct Foo;
impl Foo {
fn foo()
}
Errors:
Compiling playground v0.0.1 (/playground)
error: expected one of `->`, `;`, `where`, or `{`, found `}`
--> src/lib.rs:5:1
|
4 | fn foo()
| --- - expected one of `->`, `;`, `where`, or `{`
| |
| while parsing this `fn`
5 | }
| ^ unexpected token
error: associated function in `impl` without body
--> src/lib.rs:4:5
|
4 | fn foo()
| ^^^^^^^-
| |
| help: provide a definition for the function: `{ <body> }`
error: aborting due to 2 previous errors
error: could not compile `playground`
To learn more, run the command again with --verbose.
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`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.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.