-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
ICE: dead: non-ADT in struct pattern
#125323
Labels
A-patterns
Relating to patterns and pattern matching
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-bug-has-test
Status: This bug is tracked inside the repo by a `known-bug` test.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Min: fn main() {
for _ in 0..0 {
[(); loop {}];
}
} |
non-ADT in struct pattern
non-ADT in struct pattern
bisects to #121206 |
This doesn't seem const-eval related to me? The panic is nowhere near const-eval, as far a I can see? Looks like some part of the pattern matching machinery is not properly dealing with the fact that the constant failed to evaluate due to an infinite loop. |
Does the following code also cause an ICE for the same reason? fn main() {
let mut sum = 0;
let a = [(); { loop {} }];
for i in 0..a.len() {
sum += a[i];
}
} |
I found the root cause, will create a PR shortly @rustbot claim |
Shunpoco
added a commit
to Shunpoco/rust
that referenced
this issue
Mar 18, 2025
This ty::Error was added in rust-lang#123428, but the root cause is the same as rust-lang#125323. After report_error is fixed, the arm isn't needed anymore. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-patterns
Relating to patterns and pattern matching
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-bug-has-test
Status: This bug is tracked inside the repo by a `known-bug` test.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: