Closed
Description
Given the following code: (playground)
trait Foo {
fn bar() {};
}
The current output is:
error: non-item in item list
--> src/lib.rs:2:16
|
1 | trait Foo {
| - item list starts here
2 | fn bar() {};
| ^ non-item starts here
3 | }
| - item list ends here
(In both stable 1.62.1 and nightly)
Ideally the output could be less generic and use more precise terms like "an unexpected semicolon" rather than "non-item" and "trait definition" rather than "item list", as well have a note that suggests removing the semicolon and provide rationale. I originally hit this error message after I added a default definition to a trait function and forgot to remove the semicolon.