Repository navigation
1.100 beta regression: panicked at compiler/rustc_hir_typeck/src/method/confirm.rs:762:54: index out of bounds: the len is 0 but the index is 0 #163804
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Code
https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/reg/ftc-0.1.5/log.txt
Possibly related:
| let import_span = self.tcx.hir_span_if_local(pick.import_ids[0].to_def_id()).unwrap(); |
Version it worked on
It most recently worked on: current stable 1.99
Version with regression
rustc --version --verbose:
1.100-beta
Backtrace
Backtrace
thread 'rustc' (1094) panicked at /rustc-dev/e3feeb59cd1bdd011a2bfcc0747b55125d9b8527/compiler/rustc_hir_typeck/src/method/confirm.rs:762:54:
[INFO] [stderr] index out of bounds: the len is 0 but the index is 0
[INFO] [stderr] stack backtrace:
[INFO] [stderr] 0: 0x7cc8e5d8a9d6 - <<std[617be2ca0a6fd877]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a373ad73a504971]::fmt::Display>::fmt
[INFO] [stderr] 1: 0x7cc8e640d08f - core[a373ad73a504971]::fmt::write
[INFO] [stderr] 2: 0x7cc8e7a8356c - <std[617be2ca0a6fd877]::sys::stdio::unix::Stderr as core[a373ad73a504971]::io::write::Write>::write_fmt
[INFO] [stderr] 3: 0x7cc8e5d5d60a - std[617be2ca0a6fd877]::panicking::default_hook::{closure#0}
[INFO] [stderr] 4: 0x7cc8e5d7f103 - std[617be2ca0a6fd877]::panicking::default_hook
[INFO] [stderr] 5: 0x7cc8e4a92665 - std[617be2ca0a6fd877]::panicking::update_hook::<alloc[2e1b2a31b91974c5]::boxed::Box<rustc_driver_impl[fec14241f8975cfd]::install_ice_hook::{closure#1}>>::{closure#0}
[INFO] [stderr] 6: 0x7cc8e5d7f5a2 - std[617be2ca0a6fd877]::panicking::panic_with_hook
[INFO] [stderr] 7: 0x7cc8e5d5d6c2 - std[617be2ca0a6fd877]::panicking::panic_handler::{closure#0}
[INFO] [stderr] 8: 0x7cc8e5d55279 - std[617be2ca0a6fd877]::sys::backtrace::__rust_end_short_backtrace::<std[617be2ca0a6fd877]::panicking::panic_handler::{closure#0}, !>
[INFO] [stderr] 9: 0x7cc8e5d5f29d - __rustc[ea4f61d10b84890b]::rust_begin_unwind
[INFO] [stderr] 10: 0x7cc8e279807c - core[a373ad73a504971]::panicking::panic_fmt
[INFO] [stderr] 11: 0x7cc8e3277f05 - core[a373ad73a504971]::panicking::panic_bounds_check
[INFO] [stderr] 12: 0x7cc8e77accc0 - <rustc_hir_typeck[8942a51420d77344]::method::confirm::ConfirmContext>::confirm
[INFO] [stderr] 13: 0x7cc8e669b1b4 - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_method_call
[INFO] [stderr] 14: 0x7cc8e668d63f - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
[INFO] [stderr] 15: 0x7cc8e6688e32 - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_if
[INFO] [stderr] 16: 0x7cc8e668f5ac - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
[INFO] [stderr] 17: 0x7cc8e6625e47 - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_block
[INFO] [stderr] 18: 0x7cc8e668d613 - <rustc_hir_typeck[8942a51420d77344]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
[INFO] [stderr] 19: 0x7cc8e662c365 - rustc_hir_typeck[8942a51420d77344]::check::check_fn
[INFO] [stderr] 20: 0x7cc8e7770187 - rustc_hir_typeck[8942a51420d77344]::typeck_with_inspect::{closure#0}
[INFO] [stderr] 21: 0x7cc8e776e58e - rustc_query_impl[dd2043a667895b0]::query_vtables::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
[INFO] [stderr] 22: 0x7cc8e6abc5fa - rustc_query_impl[dd2043a667895b0]::execution::try_execute_query::<rustc_data_structures[16bfc8b56cfc6142]::vec_cache::VecCache<rustc_span[4b7b5a53591785e6]::def_id::LocalDefId, rustc_middle[264df97201bda3a9]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[264df97201bda3a9]::dep_graph::graph::DepNodeIndex>, false>
[INFO] [stderr] 23: 0x7cc8e6abc22d - rustc_query_impl[dd2043a667895b0]::query_vtables::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
[INFO] [stderr] 24: 0x7cc8e67e731c - <rustc_middle[264df97201bda3a9]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[7da984f530155d80]::check_crate::{closure#1}>::{closure#0}
[INFO] [stderr] 25: 0x7cc8e67e69cb - rustc_hir_analysis[7da984f530155d80]::check_crate
[INFO] [stderr] 26: 0x7cc8e6ab8fca - rustc_interface[f286839d7ce16120]::passes::analysis
[INFO] [stderr] 27: 0x7cc8e745b547 - rustc_query_impl[dd2043a667895b0]::execution::try_execute_query::<rustc_middle[264df97201bda3a9]::query::caches::SingleCache<rustc_middle[264df97201bda3a9]::query::erase::ErasedData<[u8; 0usize]>>, false>
[INFO] [stderr] 28: 0x7cc8e745b32b - rustc_query_impl[dd2043a667895b0]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
[INFO] [stderr] 29: 0x7cc8e75a87c9 - rustc_interface[f286839d7ce16120]::interface::run_compiler::<(), rustc_driver_impl[fec14241f8975cfd]::run_compiler::{closure#0}>::{closure#2}
[INFO] [stderr] 30: 0x7cc8e761f7e4 - std[617be2ca0a6fd877]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f286839d7ce16120]::util::run_in_thread_with_globals<rustc_interface[f286839d7ce16120]::util::run_in_thread_pool_with_globals<rustc_interface[f286839d7ce16120]::interface::run_compiler<(), rustc_driver_impl[fec14241f8975cfd]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
[INFO] [stderr] 31: 0x7cc8e761f57d - <std[617be2ca0a6fd877]::thread::lifecycle::spawn_unchecked<rustc_interface[f286839d7ce16120]::util::run_in_thread_with_globals<rustc_interface[f286839d7ce16120]::util::run_in_thread_pool_with_globals<rustc_interface[f286839d7ce16120]::interface::run_compiler<(), rustc_driver_impl[fec14241f8975cfd]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[a373ad73a504971]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stderr] 32: 0x7cc8e762a3ad - <std[617be2ca0a6fd877]::sys::thread::unix::Thread>::new::thread_start
[INFO] [stderr] 33: 0x7cc8e0882dfa - <unknown>
[INFO] [stderr] 34: 0x7cc8e09163d4 - clone
[INFO] [stderr] 35: 0x0 - <unknown>
[INFO] [stderr]
[INFO] [stderr] error: the compiler unexpectedly panicked. This is a bug
[INFO] [stderr]
[INFO] [stderr] note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
[INFO] [stderr]
[INFO] [stderr] note: rustc 1.100.0-beta.1 (e3feeb59c 2026-09-27) running on x86_64-unknown-linux-gnu
[INFO] [stderr]
[INFO] [stderr] note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
[INFO] [stderr]
[INFO] [stderr] note: some of the compiler flags provided by cargo are hidden
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
mejrs commentedon Oct 5, 2026
Possibly related to #149058 or #159599 cc @LorrensP-2158466 @petrochenkov
LorrensP-2158466 commentedon Oct 5, 2026
@mejrs, I could fix this, but i can't seem to reproduce this locally? is there something else i need to to since its on beta? (never done this)
mejrs commentedon Oct 7, 2026
I don't know, maybe you are on an outdated beta/nightly?
LorrensP-2158466 commentedon Oct 8, 2026
alright, so it fails with latest beta but not with latest nightly or the main branch. I would say its fixed? Or i am definitely doing something wrong:
nightly is commit: 1d81eb4
and beta: a2eb609
so i believe its already fixed on nightly?
mejrs commentedon Oct 8, 2026
It's possible it's been fixed accidentally, if so a regression test should be added.
In any case, it would be nice to do a beta backport of the fix.
mejrs commentedon Oct 8, 2026
Oh, I think this might be #162857, can you confirm?
LorrensP-2158466 commentedon Oct 8, 2026
You know, I thought I was going crazy because I know that issue/pr 😅. Glad I am not
LorrensP-2158466 commentedon Oct 8, 2026
Had to double check, but yeah the issue references the exact location the ICE happens as this issue.
theemathas commentedon Oct 10, 2026
Another instance of this ICE: https://crater-reports.s3.amazonaws.com/beta-1.100-3/1.100.0-beta.1/reg/spacer-0.5.0/log.txt
darkraider01 commentedon Oct 10, 2026
I was looking through this and #162904, and the fix there does seem to explain the ICE, since the ambiguity flag and
import_idscould end up coming from different candidates.One thing I noticed though: the nightly build of
ftcfails earlier inproc-macro2, so that run doesn't really confirm whether the ICE is gone.Since #162904 is already accepted for beta backport, might be worth checking both
ftcandspacerbefore and after the fix? Mainly to confirm that both reproduce the same ICE without it, and that applying #162904 gets rid of the panic in both cases, rather than just hitting an unrelated compilation error earlier.theemathas commentedon Oct 14, 2026
I have verified locally that
rustc 1.100.0-beta.5 (8ea38001b 2026-10-13)fixes both ICEs.