Skip to content

Recover from incorrect use of semicolon in various empty declaration/impl #102262

Closed
@Rageking8

Description

@Rageking8

Given the following code: link

trait Trait;

impl Trait for ();

enum Enum;

fn main() {

}

The current output is:

   Compiling playground v0.0.1 (/playground)
error: expected one of `:`, `<`, `=`, `where`, or `{`, found `;`
 --> src/main.rs:1:12
  |
1 | trait Trait;
  |            ^ expected one of `:`, `<`, `=`, `where`, or `{`

error: could not compile `playground` due to previous error

Ideally the output should suggest adding {} for each of the incorrect empty declaration/impl shown above. Thanks.

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions