-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Given the following code (playground):
fn<T> id(x: T) -> T { x }
The current output is:
error: expected identifier, found `<`
--> src/lib.rs:1:3
|
1 | fn<T> id(x: T) -> T { x }
| ^ expected identifier
Ideally the output should look also include:
help: place the generic parameter list after the function name:
|
1 | fn id<T>(x: T) -> T { x }
| ~~~
This is an easy mistake to make because impl
items do require the generic parameters to go immediately after the keyword.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.