-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 an ICE when attempting to transmute an uninhabited type #50803
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
23cc8da
to
e6c9a68
Compare
f(x) | ||
} | ||
|
||
fn main() {} |
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.
This test doesn't seem to trigger the ICE on current nightly. Possibly because the unused functions get never codegen'd?
NB: I would have expected a compile-pass test instead of run-pass (and with suitable crate type to avoid the dummy main)
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.
Good point on both counts — I've updated the test; thanks.
e6c9a68
to
d5de930
Compare
r? @eddyb |
src/librustc_trans/mir/block.rs
Outdated
// we can do what we like. Here, we declare that transmuting | ||
// into an uninhabited type is impossible, so anything following | ||
// it must be unreachable. | ||
bx.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.
Could you assert_eq!(bx.cx.layout_of(sig.output()).abi, Abi::Uninhabited)
here?
@bors r+ |
📌 Commit d8cba6b has been approved by |
☔ The latest upstream changes (presumably #50615) made this pull request unmergeable. Please resolve the merge conflicts. |
d8cba6b
to
e172330
Compare
a400529
to
f900333
Compare
@bors r+ |
📌 Commit f900333 has been approved by |
Fix an ICE when attempting to transmute an uninhabited type Fixes #50570.
☀️ Test successful - status-appveyor, status-travis |
Fixes #50570.