Skip to content

suggest removing ; after derive attribute in case of error #93942

New issue

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

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

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Feb 12, 2022 · 1 comment · Fixed by #94633
Closed

suggest removing ; after derive attribute in case of error #93942

matthiaskrgr opened this issue Feb 12, 2022 · 1 comment · Fixed by #94633
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 12, 2022

Given the following code:

#[derive(Debug, Clone)];
struct Todo {
    item: String,
}

The current output is:

error: expected item after attributes
 --> src/main.rs:5:1
  |
5 | #[derive(Debug, Clone)];
  | ^^^^^^^^^^^^^^^^^^^^^^^

Ideally the output should look like:

Rust could point at the semicolon (which causes the error) and suggest removing it in this case.

@matthiaskrgr matthiaskrgr 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. D-papercut Diagnostics: An error or lint that needs small tweaks. labels Feb 12, 2022
@estebank estebank added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Feb 18, 2022
@nerandell
Copy link

@rustbot claim

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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.

3 participants