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

Remove semicolon note #46258

Merged
merged 10 commits into from
Nov 28, 2017
Merged

Remove semicolon note #46258

merged 10 commits into from
Nov 28, 2017

Conversation

colinmarsh19
Copy link
Contributor

In reference to issue #46186
r? @estebank

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

Added note that specifies a semicolon should be removed after a given struct
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2017

struct Struct {
a: usize,
} //~ ERROR expected item, found ';'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the ;? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, good point. Forgot to copy that over

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, a couple of nitpicks inline. r=me once they're taken care of.

}; //~ ERROR expected item, found ';'
//~| NOTE consider removing the semicolon

fn main() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you turn this into a ui test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I go ahead and remove this file from parse-fail then?

return Err(self.fatal(&format!("expected item, found `{}`", token_str)));
let mut err = self.fatal(&format!("expected item, found `{}`", token_str));
if token_str == ";" {
err.note("consider removing the semicolon");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this into a span_suggestion_short(span, msg, "".to_string()), so that the output points at it and tools depending on the RLS can apply the change automatically.

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 25, 2017
@colinmarsh19
Copy link
Contributor Author

r? @estebank

Don't know why the builds are failing, I've tested them on my local branch and they seem to be working just fine. If you have any tips to help out lmk.

@estebank
Copy link
Contributor

The complaint from the test was

[00:53:55] unexpected errors (from JSON output): [
[00:53:55]     Error {
[00:53:55]         line_num: 15,
[00:53:55]         kind: Some(
[00:53:55]             Error
[00:53:55]         ),
[00:53:55]         msg: "15:2: 15:3: expected item, found `;`"
[00:53:55]     }
[00:53:55] ]
[00:53:55] 
[00:53:55] not found errors (from test file): [
[00:53:55]     Error {
[00:53:55]         line_num: 15,
[00:53:55]         kind: Some(
[00:53:55]             Error
[00:53:55]         ),
[00:53:55]         msg: "expected item, found \';\'"
[00:53:55]     },
[00:53:55]     Error {
[00:53:55]         line_num: 15,
[00:53:55]         kind: Some(
[00:53:55]             Note
[00:53:55]         ),
[00:53:55]         msg: "consider removing the semicolon"
[00:53:55]     }

Which means that the suggestion wasn't being emitted and that there was a typo in the error message parsing. For the second, you can get away with keeping only the beginning of the text for it to match without having to worry about special characters.

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2017
@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 26, 2017

📌 Commit 096e698 has been approved by estebank

@estebank estebank added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 26, 2017
kennytm added a commit to kennytm/rust that referenced this pull request 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
bors added a commit that referenced this pull request Nov 27, 2017
Rollup of 10 pull requests

- Successful merges: #45506, #46174, #46231, #46240, #46249, #46258, #46262, #46275, #46282, #46285
- Failed merges:
@bors bors merged commit 096e698 into rust-lang:master Nov 28, 2017
zackmdavis added a commit to zackmdavis/rust that referenced this pull request 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 pull request 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants