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 a parser ICE on invalid fn body #87646

Merged
merged 1 commit into from
Aug 3, 2021
Merged

Conversation

JohnTitor
Copy link
Member

Fixes #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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 30, 2021
@estebank
Copy link
Contributor

FWIW, I'm ok with the code change as it is.

} else {
return Err(err);
}
} else {
unreachable!()
Copy link
Contributor

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.

Copy link
Contributor

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.)

Copy link
Contributor

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.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 2, 2021

Seems ok, even if the first parser error is unfortunately not great. The second error clears up things, so that is good.

@JohnTitor
Copy link
Member Author

The issue is already open: #87647
@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Aug 2, 2021

📌 Commit d2d8519 has been approved by oli-obk

@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 Aug 2, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 3, 2021
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`
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 3, 2021
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``
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 3, 2021
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
@bors bors merged commit f69daa2 into rust-lang:master Aug 3, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 3, 2021
@JohnTitor JohnTitor deleted the fix-parser-ice branch August 3, 2021 13:47
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
Development

Successfully merging this pull request may close these issues.

ICE on nightly 1.56.0 (2021-07-29) when missing semicolon or function body in impl block
6 participants