-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 a parser ICE on invalid fn
body
#87646
Conversation
FWIW, I'm ok with the code change as it is. |
} else { | ||
return Err(err); | ||
} | ||
} else { | ||
unreachable!() |
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.
maybe add a delay_span_bug
to protect against this ever passing compilation.
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.
unreachable!()
is equivalent to bug!()
, isn't it? (Unless that's only the case for debug
builds.)
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.
esteban and I had a short chat. This is ok, even if not idea. There should be an issue mentioning the wrong first error suggestion (as seen in the newly added test) and that we should find a way to avoid that message and just show the second one.
r=me with that issue opened.
Seems ok, even if the first parser error is unfortunately not great. The second error clears up things, so that is good. |
📌 Commit d2d8519 has been approved by |
Fix a parser ICE on invalid `fn` body Fixes rust-lang#87635 A better fix would add a check for `fn` body on `expected_one_of_not_found` but I haven't come up with a graceful way. Any idea? r? `@oli-obk` `@estebank`
Fix a parser ICE on invalid `fn` body Fixes rust-lang#87635 A better fix would add a check for `fn` body on `expected_one_of_not_found` but I haven't come up with a graceful way. Any idea? r? ``@oli-obk`` ``@estebank``
Rollup of 8 pull requests Successful merges: - rust-lang#87645 (Properly find owner of closure in THIR unsafeck) - rust-lang#87646 (Fix a parser ICE on invalid `fn` body) - rust-lang#87652 (Validate that naked functions are never inlined) - rust-lang#87685 (Write docs for SyncOnceCell From and Default impl) - rust-lang#87693 (Add `aarch64-apple-ios-sim` as a possible target to the manifest) - rust-lang#87708 (Add convenience method for handling ipv4-mapped addresses by canonicalizing them) - rust-lang#87711 (Correct typo) - rust-lang#87716 (Allow generic SIMD array element type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #87635
A better fix would add a check for
fn
body onexpected_one_of_not_found
but I haven't come up with a graceful way. Any idea?r? @oli-obk @estebank