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

Bail out when encountering likely missing turbofish in parser #64192

Merged
merged 2 commits into from
Sep 7, 2019

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Sep 5, 2019

When encountering a likely intended turbofish without ::, bubble
up the diagnostic instead of emitting it to allow the parser to recover
more gracefully and avoid uneccessary type errors that are likely to be
wrong.

Fix #61329.

When encountering a likely intended turbofish without `::`, bubble
up the diagnostic instead of emitting it to allow the parser to recover
more gracefully and avoid uneccessary type errors that are likely to be
wrong.
@estebank
Copy link
Contributor Author

estebank commented Sep 5, 2019

r? @Centril

@Centril
Copy link
Contributor

Centril commented Sep 5, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Sep 5, 2019

📌 Commit afcf9b2 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 5, 2019
@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor Author

estebank commented Sep 5, 2019

@Centril please take a look at the test change I made. I'm confident it is ok to not care about how we pprint incorrect expressions, but you might disagree :)

@Centril
Copy link
Contributor

Centril commented Sep 6, 2019

Hmm; why is this producing incorrect expressions to pretty print in the first place?
I'd like a second eye on this.

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned Centril Sep 6, 2019
@estebank
Copy link
Contributor Author

estebank commented Sep 6, 2019

Its a test that generates chained expressions programmatically. I could make a couple of changes to avoid creating chained comparisons but didn't look at the code closely enough to figure it out.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 6, 2019
@petrochenkov petrochenkov 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 Sep 6, 2019
@Centril
Copy link
Contributor

Centril commented Sep 6, 2019

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Sep 6, 2019

📌 Commit dc613c6 has been approved by petrochenkov

Centril added a commit to Centril/rust that referenced this pull request Sep 7, 2019
…chenkov

Bail out when encountering likely missing turbofish in parser

When encountering a likely intended turbofish without `::`, bubble
up the diagnostic instead of emitting it to allow the parser to recover
more gracefully and avoid uneccessary type errors that are likely to be
wrong.

Fix rust-lang#61329.
bors added a commit that referenced this pull request Sep 7, 2019
Rollup of 10 pull requests

Successful merges:

 - #63919 (Use hygiene for AST passes)
 - #63927 (Filter linkcheck spurious failure)
 - #64149 (rustc_codegen_llvm: give names to non-alloca variable values.)
 - #64192 (Bail out when encountering likely missing turbofish in parser)
 - #64231 (Move the HIR CFG to `rustc_ast_borrowck`)
 - #64233 (Correct pluralisation of various diagnostic messages)
 - #64236 (reduce visibility)
 - #64240 (Include compiler-rt in the source tarball)
 - #64241 ([doc] Added more prereqs and note about default directory)
 - #64243 (Move injection of attributes from command line to `libsyntax_ext`)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Sep 7, 2019

☔ The latest upstream changes (presumably #64246) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 7, 2019
@bors bors merged commit dc613c6 into rust-lang:master Sep 7, 2019
@estebank estebank deleted the turbofish-madness branch November 9, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc produced incorrect error if code contains syntax errors
5 participants