Closed
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.