Closed
Description
Given this code, where a path separator is typoed as a single instead of double colon:
struct Foo { a: () }
fn main() {
Foo:new();
}
the compiler currently outputs:
error[E0423]: expected value, found struct `Foo`
--> src/main.rs:4:5
|
1 | struct Foo { a: () }
| -------------------- `Foo` defined here
...
4 | Foo:new();
| ^^^ help: use struct literal syntax instead: `Foo { a: val }`
error[E0412]: cannot find type `new` in this scope
--> src/main.rs:4:9
|
4 | Foo:new();
| -^^^ not found in this scope
| |
| help: maybe you meant to write a path separator here: `::`
This output is quite decent already: the second diagnostic correctly identifies that I meant to write a path separator and suggests a fix. However, before I read the second diagnostic, I naturally read the first diagnostic, which is entirely unhelpful. It would be better if the suggestion could be on the first diagnostic, or if the diagnostics could be combined in some way.