Uh oh!
There was an error while loading. Please reload this page.
Use heuristics to recover parsing of missing ; - #65640
Conversation
rust-highfive
commented
Oct 20, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
estebank
commented
Oct 20, 2019
Still needs a bit of a clean up, but the idea is to detect some common typos that can occur during development and the lack of a semicolon, which is also quite common when writing code. |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1b45a9b to
dd05f9fCompare
This comment has been minimized.
This comment has been minimized.
;;
This comment has been minimized.
This comment has been minimized.
RalfJung
commented
Oct 22, 2019
@bors retry |
44947a8 to
7232f47Compareestebank
commented
Oct 24, 2019
r? @Centril |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The logic here seems very similar to the case in my comment above -- a refactoring opportunity?
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
de4d5fb to
01741d2Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
01741d2 to
1c1778bCompareThere was a problem hiding this comment.
I like the look of this error, but it is slightly misleading because it could have been any of the other expected tokens, but given it was followed by a "token capable of starting statement", I feel comfortable to ignore the other possibilities. What do you think?
There was a problem hiding this comment.
Seems reasonable as a heuristic. You could optionally add a note below for the additional expected tokens. I'll leave that up to you.
There was a problem hiding this comment.
In the change above this one the word here is removed in this PR (“ ^^ expected fn here”), while it is still present in this change.
Is that as intended?
There was a problem hiding this comment.
Updated these as well, but they affect a huge amount of tests, I'll leave it as a separate PR.
Centril
commented
Oct 26, 2019
r=me with or without the additional note and "here". |
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
3a7e597 to
e8016c2Compareestebank
commented
Oct 28, 2019
@bors r=Centril |
bors
commented
Oct 28, 2019
📌 Commit e8016c2 has been approved by |
…ntril Use heuristics to recover parsing of missing `;` - Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon. Fixrust-lang#48160, fixrust-lang#44767 (after adding note about statements).
Rollup of 9 pull requests Successful merges: - #65563 (Add long error explanation for E0587) - #65640 (Use heuristics to recover parsing of missing `;`) - #65643 (Correct handling of type flags with `ConstValue::Placeholder`) - #65825 (rustc: use IndexVec<DefIndex, T> instead of Vec<T>.) - #65858 (suggest `const_in_array_repeat_expression` flag) - #65877 (doc: introduce `once` in `iter::chain` document) - #65887 (doc: mention `get(_mut)` in Vec) - #65891 (self-profiling: Record something more useful for crate metadata generation event.) - #65893 (Output previous stable error messaging when using stable build.) Failed merges: r? @ghost
bors
commented
Oct 29, 2019
☔ The latest upstream changes (presumably #65907) made this pull request unmergeable. Please resolve the merge conflicts. |
,and:typos where;was intended.detect a missing semicolon.
Fix#48160, fix#44767 (after adding note about statements).