-
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
ICE: index is out of bounds #13943
ICE: index is out of bounds #13943
Conversation
Do you have a more standalone example without the extra crate dependencies? Something like this sadly doesn't trigger the bug: fn main() {
let e: Result<int, int> = Ok(3);
match e {
Some(x) => {}
Err(y) => {}
}
} |
I'll see if I can narrow it down,I wanted to make a record of it before I crashed. |
fn main() {
let e: Result<int, int> = Ok(3);
match e {
Some(x) => x.unwrap(),
Err(y) => {}
}
} Explodes rustc |
Thanks! |
I've committed the testcase as a compile-fail on my fork, I'm planning to work on a fix tonight. |
I've made this a PR with the failing case. I'll ping you again when I have the fix ready. Thanks again! |
This change makes internal compile errors in the compile-fail tests failures. I believe this is the correct behaviour- those tests are intended to assert that the compiler doesn't proceed, not that it explodes. So far, it fails on 4 tests in my environment, my testcase for #13943 which is what caused me to tackle this, and 3 others: ``` failures: [compile-fail] compile-fail/incompatible-tuple.rs # This one is mine and not on master [compile-fail] compile-fail/inherit-struct8.rs [compile-fail] compile-fail/issue-9725.rs [compile-fail] compile-fail/unsupported-cast.rs ```
Closing due to inactivity, but feel free to reopen with the fix! |
I think this should still stay open (making it into a PR might have been a mistake). The code isn't mergable (although I could make it ignored, and just a placeholder test for when it's fixed), the underlying issue is still a bug. |
This looks like it's covered by #13774 |
Full error:
The code I was compiling is:
The ICE only happens when I call
unwrap
online
. Otherwise it just explodes because of my inconsistent types.