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 two ICEs in the parser #86010

Merged
merged 2 commits into from
Jun 7, 2021
Merged

Fix two ICEs in the parser #86010

merged 2 commits into from
Jun 7, 2021

Conversation

FabianWolff
Copy link
Contributor

This pull request fixes #84104 and fixes #84148. The latter is caused by an invalid assert_ne!() in the parser, which I have simply removed because the error is then caught in another part of the parser.

#84104 is somewhat more subtle and has to do with a suggestion to remove extraneous < characters; for instance:

fn main() {
    foo::<Ty<<<i32>();
}

currently leads to

error: unmatched angle brackets
 --> unmatched-langle.rs:2:10
  |
2 |     foo::<Ty<<<i32>();
  |          ^^^ help: remove extra angle brackets

which is obviously wrong and stems from the fact that the code for issuing the above suggestion does not consider the possibility that there might be other tokens in between the opening angle brackets. In #84104, this has led to a span being generated that ends in the middle of a multi-byte character (because the code issuing the suggestion thought that it was only skipping over <, which are single-byte), causing an ICE.

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 4, 2021
@varkor
Copy link
Member

varkor commented Jun 6, 2021

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 6, 2021

📌 Commit 6a6a605 has been approved by varkor

@bors bors 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 Jun 6, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2021
…laumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#83433 (Pass --cfg=bootstrap for proc macros built by stage0)
 - rust-lang#84940 (Don't run sanity checks for `x.py setup`)
 - rust-lang#85912 (Use `Iterator::any` and `filter_map` instead of open-coding them)
 - rust-lang#85965 (Remove dead code from `LocalAnalyzer`)
 - rust-lang#86010 (Fix two ICEs in the parser)
 - rust-lang#86040 (Fix display for search results)
 - rust-lang#86058 (Remove `_`  from E0121 diagnostic suggestions)
 - rust-lang#86077 (Fix corrected example in E0759.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1bef90f into rust-lang:master Jun 7, 2021
@rustbot rustbot added this to the 1.54.0 milestone Jun 7, 2021
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
5 participants