-
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 out of bounds: the len is 0 but the index is 0', src/librustc_typeck/check/pat.rs:729:23 #64744
Comments
Ok, this tries to eliminate stuff, but it doesn't fix the ICE: najamelan/pharos@8b1db4c Removing the match fixes the ICE. |
Minimal reproducer: struct A(());
fn main() {
let A() = A(());
} Problem was introduced in #64619. Specifically the line: rust/src/librustc_typeck/check/pat.rs Line 729 in 6ef275e
is the problem... Seems we neglected to account for the nullary tuple case ( () ). The fix is to account for the lack of any elements in deciding what spans to use.
|
NM |
@Centril I see you self-assigned, just add |
@Centril In case you haven't started, I can help with this. |
Investigating a possibly better solution than @estebank's for the zero case, I'll let you know how it pans out. |
Fixed in #64748. |
Fix rust-lang#64744. Account for the Zero sub-pattern case. Fixes rust-lang#64744. r? @estebank
Rollup of 16 pull requests Successful merges: - #63356 (Issue#63183: Add fs::read_dir() and ReadDir warning about iterator order + example) - #63934 (Fix coherence checking for impl trait in type aliases) - #64016 (Streamline `Compiler`) - #64296 (Document the unstable iter_order_by library feature) - #64443 (rustdoc: general cleanup) - #64622 (Add a cycle detector for generic `Graph`s and `mir::Body`s) - #64689 (Refactor macro by example) - #64698 (Recover on `const X = 42;` and infer type + Error Stash API) - #64702 (Remove unused dependencies) - #64717 (update mem::discriminant test to use assert_eq and assert_ne over comparison operators) - #64720 ( remove rtp.rs, and move rtpSpawn and RTP_ID_ERROR to libc) - #64721 (Fixed issue from #64447) - #64725 (fix one typo) - #64737 (fix several issues in String docs) - #64742 (relnotes: make compatibility section more sterile and fix rustc version) - #64748 (Fix #64744. Account for the Zero sub-pattern case.) Failed merges: r? @ghost
commit that introduced ICE: najamelan/pharos@fa9b467
The ICE happens on
cargo check
.The most fundamental change here I imagine is introducing
continue
inside the match...Backtrace
The text was updated successfully, but these errors were encountered: