Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Rageking8 opened this issue Sep 25, 2022 · 0 comments · Fixed by #102286
Closed

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

Rageking8 opened this issue Sep 25, 2022 · 0 comments · Fixed by #102286
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Rageking8
Copy link
Contributor

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.

@Rageking8 Rageking8 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 25, 2022
@compiler-errors compiler-errors self-assigned this Sep 25, 2022
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this issue Sep 26, 2022
…ock-item, r=davidtwco

Recover some items that expect braces and don't take semicolons

Fixes rust-lang#102262
@bors bors closed this as completed in 6f5e8c2 Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants