-
Notifications
You must be signed in to change notification settings - Fork 13.4k
parser: fix suppression of syntax errors in range RHS #33311
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Invalid expressions on the RHS were just swallowed without generating an error. The new code more closely mirrors the code for parsing `..x` in the `parse_prefix_range_expr` method, where no cancel is done either. Fixes rust-lang#33262.
I don't think it is that simple, this seems to be an experimental parse, where if we can't parse as the rhs we parse the range as open on the right ( I'm not actually sure that will work, I think we would need to rewind any tokens eaten while we did that parse, and there is no way to do that afaik. So the logic may be broken or it might be that to fix #33262 the error should be found and reported elsewhere, I only had a cursory look at the code so I'm not sure. cc @durka |
@nrc I was thinking about that, and found two questions:
|
Hmm, looking closer at the history, we should probably emit instead of cancelling here, it might be worth doing that explicitly and trying to recover, but probably not. I think this PR is correct.
yeah, looks like the cancel was an ad hoc fix for an ICE, rather than a deliberate strategy.
Agreed. @bors: r+ |
📌 Commit a36fb46 has been approved by |
Thanks for the review! |
⌛ Testing commit a36fb46 with merge 2f9a29c... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors: retry I just restarted the buildmaster which should hopefully fix this issue. On Tue, May 3, 2016 at 4:23 AM, bors [email protected] wrote:
|
@bors: retry |
parser: fix suppression of syntax errors in range RHS Invalid expressions on the RHS were just swallowed without generating an error. The new version more closely mirrors the code for parsing `..x` in the `parse_prefix_range_expr` method below, where no cancel is done either. Fixes #33262.
Invalid expressions on the RHS were just swallowed without generating an error. The new version more closely mirrors the code for parsing
..x
in theparse_prefix_range_expr
method below, where no cancel is done either.Fixes #33262.