Closed
Description
Given the following code:
struct Foo;
fn From<i32> for Foo {
fn from(a: i32) -> Self {
Foo
}
}
fn main() {}
The current output is:
error: expected `(`, found keyword `for`
--> src/main.rs:3:14
|
3 | fn From<i32> for Foo {
| ^^^ expected `(`
I wonder if we can detect that this is supposed to be trait impl, maybe look for <Trait> for <Ty>
or something?
Ideally the output should look like:
--> src/main.rs:3:14
|
3 | fn From<i32> for Foo {
| ^^ expected `impl`, found "fn"