Skip to content

Suggest removal of stray ; after struct definition #46186

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
estebank opened this issue Nov 22, 2017 · 5 comments
Closed

Suggest removal of stray ; after struct definition #46186

estebank opened this issue Nov 22, 2017 · 5 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. WG-diagnostics Working group: Diagnostics

Comments

@estebank
Copy link
Contributor

For the given code

struct Struct {
    a: usize,
};

the output is only

error: expected item, found `;`
  --> file.rs:15:2
   |
15 | };
   |  ^

where it should suggest removing the semicolon (as a suggestion so the RLS does the right thing)

error: expected item, found `;`
  --> file.rs:15:2
   |
15 | };
   |  ^ consider removing this semicolon

This is an edge situation, but I feel it is a common enough typo I've made and that is very likely to happen to newcomers.

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. WG-diagnostics Working group: Diagnostics labels Nov 22, 2017
@raventid
Copy link
Contributor

I'll take this one :)

@est31
Copy link
Member

est31 commented Nov 23, 2017

Newcomers from C++ are likely to hit this error.

@colinmarsh19
Copy link
Contributor

@jjolly @raventid I think I almost have a working solution to this. Will make a pull request when I compile in test.

kennytm added a commit to kennytm/rust that referenced this issue Nov 27, 2017
Remove semicolon note

In reference to issue rust-lang#46186
r? @estebank

First time doing a pull request, if there are any suggestions on how to improve this please let me know.
@jjolly
@colinmarsh19
Copy link
Contributor

colinmarsh19 commented Nov 28, 2017

This can be closed due to #46312 and #46258, I believe.

@kennytm
Copy link
Member

kennytm commented Nov 28, 2017

Closing as fixed in #46258. Thanks for contribution!

@kennytm kennytm closed this as completed Nov 28, 2017
zackmdavis added a commit to zackmdavis/rust that referenced this issue Jun 30, 2018
Previously (issue rust-lang#46186, pull-request rust-lang#46258), a suggestion was added
to remove the semicolon after we fail to parse an item, but issue rust-lang#51603
complains that it's still insufficiently obvious why. Let's add a note.

Resolves rust-lang#51603.
bors added a commit that referenced this issue Jul 8, 2018
clarify why we're suggesting removing semicolon after braced items

Previously (issue #46186, pull-request #46258), a suggestion was added
to remove the semicolon after we fail to parse an item, but issue #51603
complains that it's still insufficiently obvious why. Let's add a note.

Resolves #51603.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

No branches or pull requests

5 participants