-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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(parse): return unpected when current token is EOF #111181
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Can you leave some explanation why this fixes the issue? I think I understand the corner case it's trying to avoid here, but I'm not totally sure. |
I have included a few descriptions in this PR, and I would really appreciate your valuable suggestions and feedback, whether it pertains to the code or the descriptions themselves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the suggested change
This comment has been minimized.
This comment has been minimized.
@bors r=davidtwco rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#108630 (Fix docs for `alloc::realloc`) - rust-lang#109084 (rustc driver: Remove argument 0 before at-expansion to prevent ICE) - rust-lang#111181 (fix(parse): return unpected when current token is EOF) - rust-lang#111656 (Use an unbounded lifetime in `String::leak`.) - rust-lang#111946 (rustdoc: Add `ItemTemplate` trait and related functions to avoid repetitively wrapping existing functions) - rust-lang#112018 (Clean up usage of `cx.tcx` when `tcx` is already set into a variable) r? `@ghost` `@rustbot` modify labels: rollup
close #111148
#111148 panic occurred because FatalError.raise() was encountered which caused by
Eof
andPound
(the last token) had same span, when parsing#
infn a<<i<Y<w<>#
.There are a few ways to solve this problem:
Eof
, then return Error directly.FatalError
when the current token isEof
.I have chosen the second option because executing
expected_one_of_not_found
when the token isEof
but not inediable
seems reasonable.