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

Fix "consider removing this semicolon" help #32710

Merged
merged 2 commits into from
Apr 5, 2016
Merged

Fix "consider removing this semicolon" help #32710

merged 2 commits into from
Apr 5, 2016

Conversation

jonas-schievink
Copy link
Contributor

Check last statement in a block, not the first.

Example of current weirdness: http://is.gd/w80J9h

The help was only rarely emitted, and if so, often incorrectly (see above playpen). It was basically only useful with single-statement functions.

Check last statement in a block, not the first
@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@nagisa
Copy link
Member

nagisa commented Apr 4, 2016

Somewhat related #21838

fn f() -> String { //~ ERROR E0269
//~^ HELP detailed explanation
0u8;
"bla".to_string(); //~ HELP consider removing this semicolon
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add a test like the one in the linked playpen too?

@nagisa
Copy link
Member

nagisa commented Apr 4, 2016

r=me with a requested test

@jonas-schievink
Copy link
Contributor Author

Done!

@nagisa
Copy link
Member

nagisa commented Apr 4, 2016

@bors r+ 99b6247

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 5, 2016
… r=nagisa

Fix "consider removing this semicolon" help

Check last statement in a block, not the first.

Example of current weirdness: http://is.gd/w80J9h

The help was only rarely emitted, and if so, often incorrectly (see above playpen). It was basically only useful with single-statement functions.
bors added a commit that referenced this pull request Apr 5, 2016
Rollup of 11 pull requests

- Successful merges: #32403, #32596, #32675, #32678, #32685, #32686, #32692, #32710, #32712, #32714, #32715
- Failed merges: #32488
@bors bors merged commit 99b6247 into rust-lang:master Apr 5, 2016
@jonas-schievink jonas-schievink deleted the consider-last-semi branch April 5, 2016 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants