Skip to content
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 1 but the index is 1 #118185

Closed
rkuklik opened this issue Nov 22, 2023 · 5 comments · Fixed by #124227
Closed

ICE: index out of bounds: the len is 1 but the index is 1 #118185

rkuklik opened this issue Nov 22, 2023 · 5 comments · Fixed by #124227
Assignees
Labels
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

@rkuklik
Copy link

rkuklik commented Nov 22, 2023

Hello,

I am sorry, but I wasn't able to reproduce the bug outside my company's project (proprietary and which I don't have the permission to share), so I can't really help here. Code like this resides in proc-macro transformed function (#[component] from leptos) and inside recursivelly calling with! macro. Here is how approximately it looks:

Code

// NOTE: This example works standalone
use std::collections::HashMap;

#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct Id(pub usize);

pub struct Source {
    pub id: Id,
    pub field1: usize,
    pub field2: usize,
}

fn main() {
    // With spelled out types this works
    let map: HashMap<_, _> = vec![Source {
        id: Id(0),
        field1: 96,
        field2: 240,
    }]
    .into_iter()
    .map(|item| (item.id, item))
    .collect();
    // Everything works fine until any op on the map
    map.get("any garbage (data type ignored)");
}

Meta

Fails on both nightly and stable, backtrace if from nightly.

rustc --version --verbose:

rustc 1.76.0-nightly (2f8d81f9d 2023-11-21)
binary: rustc
commit-hash: 2f8d81f9dbac6b8df982199f69da04a4c8357227
commit-date: 2023-11-21
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

rustc 1.74.0 (79e9716c9 2023-11-13)
binary: rustc
commit-hash: 79e9716c980570bfd1f666e3b16ac583f0168962
commit-date: 2023-11-13
host: x86_64-unknown-linux-gnu
release: 1.74.0
LLVM version: 17.0.4

Error output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: no errors reported for args
  --> src/fitness/ui.rs:83:37
   |
83 |                 slot.capacity = map.get(slot.index).unwrap_or_default();
   |                                     ^^^
   |
note: delayed at compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:525:22
  --> src/fitness/ui.rs:83:37
   |
83 |                 slot.capacity = map.get(slot.index).unwrap_or_default();
   |                                     ^^^

error: internal compiler error: {OpaqueTypeKey { def_id: DefId(0:3302 ~ addon[ef77]::fitness::ui::FitnessForm::__FitnessForm::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/fitness/ui.rs:29:25: 29:38 (#2594), ty: ?0t } }}
  |
  = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:44:26
Backtrace

thread 'rustc' panicked at compiler/rustc_hir_typeck/src/demand.rs:395:52:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
   0:     0x7ffb8f772ba1 - std::backtrace_rs::backtrace::libunwind::trace::h5e85954398d12ce3
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7ffb8f772ba1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd106003daf308f1b
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffb8f772ba1 - std::backtrace::Backtrace::create::h258b89056f4f50c8
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/backtrace.rs:332:13
   3:     0x7ffb8f772af0 - std::backtrace::Backtrace::force_capture::hfbfae9ab8ad6a39f
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/backtrace.rs:313:9
   4:     0x7ffb924f354c - std[5f6dbc7992e36f36]::panicking::update_hook::<alloc[73e8f31ebd2d06b4]::boxed::Box<rustc_driver_impl[1b37cd9153daf3ad]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7ffb8f78dcb8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h583f85f885642a98
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2021:9
   6:     0x7ffb8f78dcb8 - std::panicking::rust_panic_with_hook::h51b7b3de85b330a5
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:783:13
   7:     0x7ffb8f78da0e - std::panicking::begin_panic_handler::{{closure}}::h9f9c9a467f60d8ba
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:657:13
   8:     0x7ffb8f78afc6 - std::sys_common::backtrace::__rust_end_short_backtrace::h037a6ad83e4b9233
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7ffb8f78d772 - rust_begin_unwind
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:645:5
  10:     0x7ffb8f7da365 - core::panicking::panic_fmt::h9cec6616f663903f
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/core/src/panicking.rs:72:14
  11:     0x7ffb8f7da582 - core::panicking::panic_bounds_check::h1891103a978651ff
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/core/src/panicking.rs:189:5
  12:     0x7ffb9267c282 - <core[b21e5049fb800f2c]::slice::iter::Iter<&rustc_hir[80643429d4d3540e]::hir::Expr> as core[b21e5049fb800f2c]::iter::traits::iterator::Iterator>::find_map::<rustc_middle[54f2c08037379b7]::ty::Ty, <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::note_source_of_type_mismatch_constraint::{closure#3}>
  13:     0x7ffb926bfa06 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::note_source_of_type_mismatch_constraint
  14:     0x7ffb926d3369 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::report_arg_errors
  15:     0x7ffb94256444 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  16:     0x7ffb94315707 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17:     0x7ffb9431522b - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18:     0x7ffb94317dbf - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19:     0x7ffb93cc2166 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_block_with_expected
  20:     0x7ffb943151e6 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:     0x7ffb94258bff - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_match
  22:     0x7ffb94315dc3 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:     0x7ffb93cc386f - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_block_with_expected
  24:     0x7ffb94318cbd - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:     0x7ffb94258bff - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_match
  26:     0x7ffb94315dc3 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7ffb943167da - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7ffb93cc386f - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_block_with_expected
  29:     0x7ffb943151e6 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  31:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  32:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7ffb94252f09 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  34:     0x7ffb9424a7ef - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_call
  35:     0x7ffb94314e57 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  37:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  38:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7ffb94252f09 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  40:     0x7ffb9424a7ef - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_call
  41:     0x7ffb94314e57 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  43:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  44:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  45:     0x7ffb94252f09 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  46:     0x7ffb9424a7ef - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_call
  47:     0x7ffb94314e57 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  48:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  49:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  50:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  51:     0x7ffb94252f09 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  52:     0x7ffb9424a7ef - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_call
  53:     0x7ffb94314e57 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  54:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  55:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  56:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  57:     0x7ffb94252f09 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_argument_types
  58:     0x7ffb9424a7ef - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_call
  59:     0x7ffb94314e57 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  60:     0x7ffb93cc2222 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_block_with_expected
  61:     0x7ffb943151e6 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  62:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  63:     0x7ffb94287752 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_closure
  64:     0x7ffb94318347 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  65:     0x7ffb93cc5995 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_decl
  66:     0x7ffb93cc3217 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_block_with_expected
  67:     0x7ffb943151e6 - <rustc_hir_typeck[812642f5044e1f66]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  68:     0x7ffb93cf6a73 - rustc_hir_typeck[812642f5044e1f66]::check::check_fn
  69:     0x7ffb93b15a72 - rustc_hir_typeck[812642f5044e1f66]::typeck
  70:     0x7ffb93b14e53 - rustc_query_impl[9991b025295daeb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9991b025295daeb1]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>
  71:     0x7ffb93d6f6c3 - rustc_query_system[886bde11500d09fb]::query::plumbing::try_execute_query::<rustc_query_impl[9991b025295daeb1]::DynamicConfig<rustc_query_system[886bde11500d09fb]::query::caches::VecCache<rustc_span[2f0fd5f8ae050e80]::def_id::LocalDefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9991b025295daeb1]::plumbing::QueryCtxt, true>
  72:     0x7ffb93d7e18b - rustc_query_impl[9991b025295daeb1]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  73:     0x7ffb945500f4 - rustc_hir_analysis[684fddeff0c0f7bf]::collect::type_of::type_of_opaque
  74:     0x7ffb9454ffdb - rustc_query_impl[9991b025295daeb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9991b025295daeb1]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>
  75:     0x7ffb93b78128 - rustc_query_system[886bde11500d09fb]::query::plumbing::try_execute_query::<rustc_query_impl[9991b025295daeb1]::DynamicConfig<rustc_query_system[886bde11500d09fb]::query::caches::DefaultCache<rustc_span[2f0fd5f8ae050e80]::def_id::DefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9991b025295daeb1]::plumbing::QueryCtxt, true>
  76:     0x7ffb94869b8b - rustc_query_impl[9991b025295daeb1]::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  77:     0x7ffb938ed4b8 - rustc_middle[54f2c08037379b7]::query::plumbing::query_get_at::<rustc_query_system[886bde11500d09fb]::query::caches::DefaultCache<rustc_span[2f0fd5f8ae050e80]::def_id::DefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>>
  78:     0x7ffb919f636f - rustc_hir_analysis[684fddeff0c0f7bf]::collect::type_of::type_of
  79:     0x7ffb93890776 - rustc_query_impl[9991b025295daeb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9991b025295daeb1]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>
  80:     0x7ffb93b78128 - rustc_query_system[886bde11500d09fb]::query::plumbing::try_execute_query::<rustc_query_impl[9991b025295daeb1]::DynamicConfig<rustc_query_system[886bde11500d09fb]::query::caches::DefaultCache<rustc_span[2f0fd5f8ae050e80]::def_id::DefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9991b025295daeb1]::plumbing::QueryCtxt, true>
  81:     0x7ffb93c60175 - rustc_query_impl[9991b025295daeb1]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
  82:     0x7ffb939fcff7 - rustc_middle[54f2c08037379b7]::query::plumbing::query_get_at::<rustc_query_system[886bde11500d09fb]::query::caches::DefaultCache<rustc_span[2f0fd5f8ae050e80]::def_id::DefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 8usize]>>>
  83:     0x7ffb941e2f54 - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  84:     0x7ffb941e2735 - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFolder<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::fold_ty
  85:     0x7ffb948c6830 - <&rustc_middle[54f2c08037379b7]::ty::list::List<rustc_middle[54f2c08037379b7]::ty::Ty> as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFoldable<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander>
  86:     0x7ffb941e27ff - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFolder<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::fold_ty
  87:     0x7ffb941e235e - <&rustc_middle[54f2c08037379b7]::ty::list::List<rustc_middle[54f2c08037379b7]::ty::generic_args::GenericArg> as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFoldable<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander>
  88:     0x7ffb941e27d7 - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFolder<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::fold_ty
  89:     0x7ffb941e2295 - <&rustc_middle[54f2c08037379b7]::ty::list::List<rustc_middle[54f2c08037379b7]::ty::generic_args::GenericArg> as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFoldable<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander>
  90:     0x7ffb941e275d - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander as rustc_type_ir[76173f0dc16ee0bf]::fold::TypeFolder<rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>>::fold_ty
  91:     0x7ffb941e2f97 - <rustc_middle[54f2c08037379b7]::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  92:     0x7ffb941e2cc4 - <rustc_middle[54f2c08037379b7]::ty::context::TyCtxt>::try_expand_impl_trait_type
  93:     0x7ffb93f82a2d - rustc_hir_analysis[684fddeff0c0f7bf]::check::check::check_mod_item_types
  94:     0x7ffb93f81413 - rustc_query_impl[9991b025295daeb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9991b025295daeb1]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 0usize]>>
  95:     0x7ffb941c4f6b - rustc_query_system[886bde11500d09fb]::query::plumbing::try_execute_query::<rustc_query_impl[9991b025295daeb1]::DynamicConfig<rustc_query_system[886bde11500d09fb]::query::caches::DefaultCache<rustc_span[2f0fd5f8ae050e80]::def_id::LocalModDefId, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9991b025295daeb1]::plumbing::QueryCtxt, true>
  96:     0x7ffb941c4a80 - rustc_query_impl[9991b025295daeb1]::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace
  97:     0x7ffb93d7cad5 - rustc_hir_analysis[684fddeff0c0f7bf]::check_crate
  98:     0x7ffb93b6af97 - rustc_interface[c52b5cc031b18b22]::passes::analysis
  99:     0x7ffb93b6abf7 - rustc_query_impl[9991b025295daeb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9991b025295daeb1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 1usize]>>
 100:     0x7ffb9478c58b - rustc_query_system[886bde11500d09fb]::query::plumbing::try_execute_query::<rustc_query_impl[9991b025295daeb1]::DynamicConfig<rustc_query_system[886bde11500d09fb]::query::caches::SingleCache<rustc_middle[54f2c08037379b7]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9991b025295daeb1]::plumbing::QueryCtxt, true>
 101:     0x7ffb9478c234 - rustc_query_impl[9991b025295daeb1]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
 102:     0x7ffb948126b8 - rustc_interface[c52b5cc031b18b22]::interface::run_compiler::<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}
 103:     0x7ffb947a3a54 - std[5f6dbc7992e36f36]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_with_globals<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_pool_with_globals<rustc_interface[c52b5cc031b18b22]::interface::run_compiler<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>
 104:     0x7ffb947a387d - <<std[5f6dbc7992e36f36]::thread::Builder>::spawn_unchecked_<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_with_globals<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_pool_with_globals<rustc_interface[c52b5cc031b18b22]::interface::run_compiler<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#1} as core[b21e5049fb800f2c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 105:     0x7ffb8f797b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h60c39ebe8387f1c8
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
 106:     0x7ffb8f797b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1ab2eeceecb887d4
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
 107:     0x7ffb8f797b75 - std::sys::unix::thread::Thread::new::thread_start::h5193a614b38f3ff0
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys/unix/thread.rs:108:17
 108:     0x7ffb8f5559eb - <unknown>
 109:     0x7ffb8f5d97cc - <unknown>
 110:                0x0 - <unknown>


rustc version: 1.76.0-nightly (2f8d81f9d 2023-11-21)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `fitness::ui::FitnessForm::__FitnessForm`
#1 [type_of_opaque] computing type of opaque `fitness::ui::FitnessForm::__FitnessForm::{opaque#0}`
#2 [type_of] computing type of `fitness::ui::FitnessForm::__FitnessForm::{opaque#0}`
#3 [check_mod_item_types] checking item types in module `fitness::ui`
#4 [analysis] running analysis passes on this crate
end of query stack
delayed span bug: no errors reported for args
   0: <rustc_errors::HandlerInner>::emit_diagnostic
   1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
   2: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_arg_errors
   3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
   4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
   8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_match
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_match
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18: rustc_hir_typeck::check::check_fn
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24: rustc_hir_typeck::check::check_fn
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30: rustc_hir_typeck::check::check_fn
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  34: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36: rustc_hir_typeck::check::check_fn
  37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  40: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  41: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42: rustc_hir_typeck::check::check_fn
  43: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  44: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  45: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  46: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  47: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  48: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  49: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  50: rustc_hir_typeck::check::check_fn
  51: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_closure
  52: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  53: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  54: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  55: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  56: rustc_hir_typeck::check::check_fn
  57: rustc_hir_typeck::typeck
  58: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
  59: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  60: rustc_query_impl::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  61: rustc_hir_analysis::collect::type_of::type_of_opaque
  62: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
  63: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  64: rustc_query_impl::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  65: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  66: rustc_hir_analysis::collect::type_of::type_of
  67: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
  68: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  69: rustc_query_impl::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
  70: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  71: <rustc_middle::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  72: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  73: <&rustc_middle::ty::list::List<rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  74: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  75: <&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  76: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  77: <&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  78: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  79: <rustc_middle::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  80: <rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type
  81: rustc_hir_analysis::check::check::check_mod_item_types
  82: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
  83: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  84: rustc_query_impl::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace
  85: rustc_hir_analysis::check_crate
  86: rustc_interface::passes::analysis
  87: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
  88: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  89: rustc_query_impl::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  90: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
  91: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  92: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  93: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  94: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  95: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys/unix/thread.rs:108:17
  96: <unknown>
  97: <unknown>

delayed span bug: {OpaqueTypeKey { def_id: DefId(0:3302 ~ addon[ef77]::fitness::ui::FitnessForm::__FitnessForm::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/fitness/ui.rs:29:25: 29:38 (#2594), ty: ?0t } }}
   0: <rustc_errors::HandlerInner>::emit_diagnostic
   1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   2: core::ptr::drop_in_place::<rustc_infer::infer::InferCtxt>
   3: core::ptr::drop_in_place::<rustc_hir_typeck::inherited::Inherited>
   4: rustc_hir_typeck::typeck
   5: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
   6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   7: rustc_query_impl::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
   8: rustc_hir_analysis::collect::type_of::type_of_opaque
   9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
  10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  11: rustc_query_impl::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  12: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  13: rustc_hir_analysis::collect::type_of::type_of
  14: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
  15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  16: rustc_query_impl::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
  17: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
  18: <rustc_middle::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  19: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  20: <&rustc_middle::ty::list::List<rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  21: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  22: <&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  23: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  24: <&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::util::OpaqueTypeExpander>
  25: <rustc_middle::ty::util::OpaqueTypeExpander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  26: <rustc_middle::ty::util::OpaqueTypeExpander>::expand_opaque_ty
  27: <rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type
  28: rustc_hir_analysis::check::check::check_mod_item_types
  29: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
  30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  31: rustc_query_impl::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace
  32: rustc_hir_analysis::check_crate
  33: rustc_interface::passes::analysis
  34: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
  35: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  36: rustc_query_impl::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  37: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
  38: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  39: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  41: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  42: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys/unix/thread.rs:108:17
  43: <unknown>
  44: <unknown>

thread 'rustc' panicked at library/core/src/panicking.rs:144:5:
panic in a destructor during cleanup
stack backtrace:
   0:     0x7ffb8f772ba1 - std::backtrace_rs::backtrace::libunwind::trace::h5e85954398d12ce3
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7ffb8f772ba1 - std::backtrace_rs::backtrace::trace_unsynchronized::hd106003daf308f1b
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffb8f772ba1 - std::backtrace::Backtrace::create::h258b89056f4f50c8
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/backtrace.rs:332:13
   3:     0x7ffb8f772af0 - std::backtrace::Backtrace::force_capture::hfbfae9ab8ad6a39f
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/backtrace.rs:313:9
   4:     0x7ffb924f354c - std[5f6dbc7992e36f36]::panicking::update_hook::<alloc[73e8f31ebd2d06b4]::boxed::Box<rustc_driver_impl[1b37cd9153daf3ad]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7ffb8f78dcb8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h583f85f885642a98
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2021:9
   6:     0x7ffb8f78dcb8 - std::panicking::rust_panic_with_hook::h51b7b3de85b330a5
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:783:13
   7:     0x7ffb8f78d9d9 - std::panicking::begin_panic_handler::{{closure}}::h9f9c9a467f60d8ba
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:649:13
   8:     0x7ffb8f78afc6 - std::sys_common::backtrace::__rust_end_short_backtrace::h037a6ad83e4b9233
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7ffb8f78d772 - rust_begin_unwind
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/panicking.rs:645:5
  10:     0x7ffb8f7da3a8 - core::panicking::panic_nounwind_fmt::h31361ed41e338141
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/core/src/panicking.rs:106:14
  11:     0x7ffb8f7da4ac - core::panicking::panic_nounwind_nobacktrace::h487578425c4a3c9f
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/core/src/panicking.rs:144:5
  12:     0x7ffb8f7da6b3 - core::panicking::panic_in_cleanup::he307408fe51ed4ad
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/core/src/panicking.rs:237:5
  13:     0x7ffb9481428b - rustc_interface[c52b5cc031b18b22]::interface::run_compiler::<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}
  14:     0x7ffb947a3a54 - std[5f6dbc7992e36f36]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_with_globals<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_pool_with_globals<rustc_interface[c52b5cc031b18b22]::interface::run_compiler<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>
  15:     0x7ffb947a387d - <<std[5f6dbc7992e36f36]::thread::Builder>::spawn_unchecked_<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_with_globals<rustc_interface[c52b5cc031b18b22]::util::run_in_thread_pool_with_globals<rustc_interface[c52b5cc031b18b22]::interface::run_compiler<core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>, rustc_driver_impl[1b37cd9153daf3ad]::run_compiler::{closure#0}>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b21e5049fb800f2c]::result::Result<(), rustc_span[2f0fd5f8ae050e80]::ErrorGuaranteed>>::{closure#1} as core[b21e5049fb800f2c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  16:     0x7ffb8f797b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h60c39ebe8387f1c8
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  17:     0x7ffb8f797b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1ab2eeceecb887d4
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/alloc/src/boxed.rs:2007:9
  18:     0x7ffb8f797b75 - std::sys::unix::thread::Thread::new::thread_start::h5193a614b38f3ff0
                               at /rustc/2f8d81f9dbac6b8df982199f69da04a4c8357227/library/std/src/sys/unix/thread.rs:108:17
  19:     0x7ffb8f5559eb - <unknown>
  20:     0x7ffb8f5d97cc - <unknown>
  21:                0x0 - <unknown>

Hope this helps and thank for your work.

@rkuklik rkuklik added C-bug Category: This is a bug. 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. labels Nov 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 22, 2023
@compiler-errors compiler-errors changed the title ICE: type inference failiure ICE: index out of bounds: the len is 1 but the index is 1 Nov 23, 2023
@compiler-errors compiler-errors added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 23, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 23, 2023
@kpreid
Copy link
Contributor

kpreid commented Dec 25, 2023

Relabeling issues which don't have a runnable reproduction (as opposed to not having a minimized one) to the new label S-needs-repro.
@rustbot label +S-needs-repro -E-needs-mcve

@rustbot rustbot added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Dec 25, 2023
@antonWetzel
Copy link

I think I encountered the same bug. A minimal example is below.

fn main() {
    let target: Target = create_target();
    target.get(0); // correct arguments work
    target.get(10.0); // CRASH HERE
}

// must be generic
fn create_target<T>() -> T {
    unimplemented!()
}

// unimplemented trait, but contains function with the same name
pub trait RandomTrait {
    fn get(&mut self); // but less arguments
}

struct Target;

impl Target {
    // correct function with arguments
    pub fn get(&self, data: i32) {
        unimplemented!()
    }
}

I think the problem is a lookup, which includes the unimplemented trait without checking the length of the argument list before accessing.

rustc --version --verbose:

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-pc-windows-msvc
release: 1.75.0
LLVM version: 17.0.6

Also fails on nightly.

nightly ructc-ice.txt

thread 'rustc' panicked at compiler\rustc_hir_typeck\src\demand.rs:403:52:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
   0:     0x7ffa14f4c884 - std::backtrace::Backtrace::force_capture::he469c48bbc73ed78
   1:     0x7ffa14f4c7e4 - std::backtrace::Backtrace::force_capture::he469c48bbc73ed78
   2:     0x7ff9d6beeca2 - <tracing_subscriber[90353078a31cc387]::fmt::format::Writer>::write_fmt
   3:     0x7ffa14f66093 - std::panicking::rust_panic_with_hook::h806f7ce9f81a7ef9
   4:     0x7ffa14f65f39 - <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box::he581e95446db7e8b
   5:     0x7ffa14f631c9 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4e51f690c01a6ffe
   6:     0x7ffa14f65c06 - rust_begin_unwind
   7:     0x7ffa14fbae47 - core::panicking::panic_fmt::h116e281faad9fb1e
   8:     0x7ffa14fbb0a4 - core::panicking::panic_bounds_check::ha855fcf85dd844a8
   9:     0x7ff9d6e777a3 - rustc_hir_typeck[558be43417a84ebb]::inspect_typeck
  10:     0x7ff9d6e87f4c - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::note_source_of_type_mismatch_constraint
  11:     0x7ff9d6e92c0b - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::blame_specific_expr_if_possible
  12:     0x7ff9d5cbf57d - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::probe_instantiate_query_response
  13:     0x7ff9d5c8c6a7 - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::demand_eqtype
  14:     0x7ff9d5cc3fe6 - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::check_struct_path
  15:     0x7ff9d5c8b8b8 - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::demand_eqtype
  16:     0x7ff9d5ca6c69 - <rustc_hir_typeck[558be43417a84ebb]::fn_ctxt::FnCtxt>::demand_eqtype
  17:     0x7ff9d5d3627e - <rustc_hir_typeck[558be43417a84ebb]::gather_locals::GatherLocalsVisitor as rustc_hir[b08b940a2b949ed3]::intravisit::Visitor>::visit_pat
  18:     0x7ff9d5c6910a - rustc_hir_typeck[558be43417a84ebb]::typeck
  19:     0x7ff9d6474bdf - <rustc_query_impl[d063917ba4a6e24d]::plumbing::QueryCtxt as rustc_query_system[10c1d65a14ee7384]::query::QueryContext>::load_side_effects
  20:     0x7ff9d65528df - <rustc_query_impl[d063917ba4a6e24d]::plumbing::QueryCtxt as rustc_query_system[10c1d65a14ee7384]::query::QueryContext>::load_side_effects
  21:     0x7ff9d651474b - <rustc_query_impl[d063917ba4a6e24d]::plumbing::QueryCtxt as rustc_query_system[10c1d65a14ee7384]::query::QueryContext>::load_side_effects
  22:     0x7ff9d6553dd1 - <rustc_query_impl[d063917ba4a6e24d]::plumbing::QueryCtxt as rustc_query_system[10c1d65a14ee7384]::query::QueryContext>::load_side_effects
  23:     0x7ff9d5da3606 - rustc_hir_analysis[ad7694e982418c93]::check_crate
  24:     0x7ff9d5b541ba - rustc_interface[860a9697faa18679]::passes::analysis
  25:     0x7ff9d56ff4dd - rustc_query_impl[d063917ba4a6e24d]::profiling_support::alloc_self_profile_query_strings
  26:     0x7ff9d57b6a89 - <dyn std[2fccd03cdc4dc1d1]::io::Write as nu_ansi_term[ed524ba3f98f72d7]::write::AnyWrite>::write_str
  27:     0x7ff9d57a5428 - <dyn std[2fccd03cdc4dc1d1]::io::Write as nu_ansi_term[ed524ba3f98f72d7]::write::AnyWrite>::write_str
  28:     0x7ff9d5726556 - rustc_query_impl[d063917ba4a6e24d]::profiling_support::alloc_self_profile_query_strings
  29:     0x7ff9d56e2c17 - rustc_query_impl[d063917ba4a6e24d]::profiling_support::alloc_self_profile_query_strings
  30:     0x7ff9d2c46ccd - <rustc_middle[bd94da99f9fcc4b9]::ty::SymbolName as core[fd47e243cb8a0c47]::fmt::Display>::fmt
  31:     0x7ff9d2c148d9 - <rustc_middle[bd94da99f9fcc4b9]::ty::SymbolName as core[fd47e243cb8a0c47]::fmt::Display>::fmt
  32:     0x7ff9d2c42c7d - <rustc_middle[bd94da99f9fcc4b9]::ty::SymbolName as core[fd47e243cb8a0c47]::fmt::Display>::fmt
  33:     0x7ff9d2c446f6 - <rustc_middle[bd94da99f9fcc4b9]::ty::SymbolName as core[fd47e243cb8a0c47]::fmt::Display>::fmt
  34:     0x7ff9d2c0a84f - rustc_driver_impl[30237640f99167db]::main
  35:     0x7ff9d2c0f718 - rustc_driver_impl[30237640f99167db]::args::arg_expand_all
  36:     0x7ffa14f77acc - std::sys::pal::windows::thread::Thread::new::h79e6e6a8115a814f
  37:     0x7ffa77db257d - BaseThreadInitThunk
  38:     0x7ffa7966aa58 - RtlUserThreadStart


rustc version: 1.78.0-nightly (8ace7ea1f 2024-02-07)
platform: x86_64-pc-windows-msvc

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack

@matthiaskrgr matthiaskrgr added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. labels Mar 4, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Apr 8, 2024

********************************************************************************
Regression in nightly-2023-06-20
********************************************************************************

fetching https://static.rust-lang.org/dist/2023-06-19/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2023-06-19: 40 B / 40 B [==========================================================================================================================================================================================================================================================] 100.00 % 892.88 KB/s converted 2023-06-19 to 2d0aa57684e10f7b3d3fe740ee18d431181583ad
fetching https://static.rust-lang.org/dist/2023-06-20/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2023-06-20: 40 B / 40 B [============================================================================================================================================================================================================================================================] 100.00 % 1.46 MB/s converted 2023-06-20 to fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2
looking for regression commit between 2023-06-19 and 2023-06-20
fetching (via remote github) commits from max(2d0aa57684e10f7b3d3fe740ee18d431181583ad, 2023-06-17) to fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2
ending github query because we found starting sha: 2d0aa57684e10f7b3d3fe740ee18d431181583ad
get_commits_between returning commits, len: 9
  commit[0] 2023-06-18: Auto merge of #112645 - Kobzol:ci-mingw-merge, r=pietroalbini
  commit[1] 2023-06-18: Auto merge of #112774 - compiler-errors:rollup-z8oof6r, r=compiler-errors
  commit[2] 2023-06-19: Auto merge of #112617 - lqd:dump-mir-dataflow, r=tmiasko
  commit[3] 2023-06-19: Auto merge of #112724 - scottmcm:simpler-unchecked-shifts, r=Mark-Simulacrum
  commit[4] 2023-06-19: Auto merge of #112784 - lnicola:sync-from-ra, r=lnicola
  commit[5] 2023-06-19: Auto merge of #112351 - BoxyUwU:proof_tree_generation, r=lcnr
  commit[6] 2023-06-19: Auto merge of #112366 - lukas-code:test, r=Nilstrieb
  commit[7] 2023-06-19: Auto merge of #112238 - scottmcm:mir-add-unchecked, r=cjgillot
  commit[8] 2023-06-19: Auto merge of #112805 - matthiaskrgr:rollup-r5yrefu, r=matthiaskrgr
ERROR: no CI builds available between 2d0aa57684e10f7b3d3fe740ee18d431181583ad and fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2 within last 167 days

@jieyouxu
Copy link
Member

jieyouxu commented Apr 8, 2024

Maybe #112537 inside rollup #112774? cc @compiler-errors

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 18, 2024
@konnorandrews
Copy link

I ran into this ICE and minimized my case to the following reproducer. Its slightly different way to get to the same case as @antonWetzel 's code above. Still happens from stable 1.77.2 to nightly 2024-04-19.

playground

fn ice() {
    let a: &dyn A = &V;

    a.x(&());
}

struct V;

impl V {
    pub fn x(&self) {
        todo!()
    }
}

trait A {
    fn x(&self, y: ());
}

impl A for V {
    fn x(&self, y: ()) {
        todo!();
    }
}

When doing a bisection I get nightly-2023-05-16.

@compiler-errors compiler-errors self-assigned this Apr 20, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 22, 2024
…res, r=estebank

Make sure that the method resolution matches in `note_source_of_type_mismatch_constraint`

`note_source_of_type_mismatch_constraint` is a pile of hacks that I implemented to cover up another pile of hacks.

It does a bunch of re-confirming methods, but it wasn't previously checking that the methods it was looking (back) up were equal to the methods we previously had. This PR adds those checks.

Fixes rust-lang#118185
@bors bors closed this as completed in f0038a7 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
9 participants