-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 ICE with -Zunpretty=hir,typed
#86645
Conversation
…nction signature
(rust-highfive has picked a reviewer for you, use r? to override) |
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.
I thought that it might be easier to update the typeck results when entering an item instead of a body, but it gets harder when you throw closures into the mix, so this LGTM.
Left two nits
Thanks for the PR! @bors r+ |
📌 Commit e8ebf98 has been approved by |
⌛ Testing commit e8ebf98 with merge b37ef75b1eb535511dc83fd831f4e06b6424a03c... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
This PR fixes #82328. The
-Zunpretty=hir,typed
pretty-printer maintains anOption
with type-checking results and sets theOption
toSome
when entering a body. However, this leads to an ICE if an expression occurs in a function signature (i.e. outside of a body), such as128
inThis PR fixes the ICE by checking (if necessary) whether the expression's owner has a body, and retrieving type-checking results for that on the fly.