-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: for_variant called on zero-variant enum: rustc_middle/src/ty/layout.rs:2254:25 #94073
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Reduced: #[derive(Copy, Clone)]
enum Never {}
union Foo {
a: u64,
b: Never
}
fn main() {
let _f = [Foo { a: 42 }];
} |
Thanks for report and test case. In #94020, I removed the special case for enums without variants, expecting that now that we handle |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 19, 2022
Fix pretty printing of enums without variants 92d20c4 removed no-variants special case from `try_destructure_const` with expectation that this case would be handled gracefully when `read_discriminant` returns an error. Alas in that case `read_discriminant` succeeds while returning a non-existing variant, so the special case is still necessary. Fixes rust-lang#94073. r? `@oli-obk`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 19, 2022
Fix pretty printing of enums without variants 92d20c4 removed no-variants special case from `try_destructure_const` with expectation that this case would be handled gracefully when `read_discriminant` returns an error. Alas in that case `read_discriminant` succeeds while returning a non-existing variant, so the special case is still necessary. Fixes rust-lang#94073. r? ``@oli-obk``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 19, 2022
Fix pretty printing of enums without variants 92d20c4 removed no-variants special case from `try_destructure_const` with expectation that this case would be handled gracefully when `read_discriminant` returns an error. Alas in that case `read_discriminant` succeeds while returning a non-existing variant, so the special case is still necessary. Fixes rust-lang#94073. r? ```@oli-obk```
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
./src/test/ui/issues/issue-46855.rs
Meta
rustc --version --verbose
:Error output
rustc --emit=mir -Zmir-opt-level=3 ./src/test/ui/issues/issue-46855.rs
Backtrace
The text was updated successfully, but these errors were encountered: