Skip to content

ICE: index out of bounds: the len is 2 but the index is 6' snapshot_vec #111500

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

pub struct A;

impl A {
    fn constant_not() {
        match () {
            _ => match Self::partial_cmp() {},
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (699a862a3 2023-05-12)
binary: rustc
commit-hash: 699a862a3d4e4a2d5603c93297c0c44021ea72f5
commit-date: 2023-05-12
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output


Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 2 but the index is 6', /cargo/registry/src/index.crates.io-6f17d22bba15001f/ena-0.14.2/src/snapshot_vec.rs:199:10
stack backtrace:
   0:     0x7f275016a051 - std::backtrace_rs::backtrace::libunwind::trace::h0af888d99ed88748
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f275016a051 - std::backtrace_rs::backtrace::trace_unsynchronized::h33bb93170b685401
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f275016a051 - std::sys_common::backtrace::_print_fmt::h74052f546c8fb653
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f275016a051 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfa632bde054ed22d
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f27501ca4af - core::fmt::rt::Argument::fmt::h5a4acada57458345
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/core/src/fmt/rt.rs:138:9
   5:     0x7f27501ca4af - core::fmt::write::h414755515d4e5243
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f275015d2b1 - std::io::Write::write_fmt::h0c3a3b741df31239
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/io/mod.rs:1712:15
   7:     0x7f2750169e65 - std::sys_common::backtrace::_print::h9ab7e58129ac9a69
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2750169e65 - std::sys_common::backtrace::print::hb1001de63a125245
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f275016cae7 - std::panicking::default_hook::{{closure}}::h299c847d3f14e1f3
  10:     0x7f275016c8d4 - std::panicking::default_hook::h4620708139d7d003
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/panicking.rs:288:9
  11:     0x7f27533dd15b - rustc_driver_impl[7dd5276dc45ad99a]::install_ice_hook::{closure#0}
  12:     0x7f275016d207 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h252df233fd3dd9b4
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/alloc/src/boxed.rs:1999:9
  13:     0x7f275016d207 - std::panicking::rust_panic_with_hook::h932c813182e2bbe7
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/panicking.rs:695:13
  14:     0x7f275016cf87 - std::panicking::begin_panic_handler::{{closure}}::h7dc2d0b08e5319c0
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/panicking.rs:582:13
  15:     0x7f275016a496 - std::sys_common::backtrace::__rust_end_short_backtrace::hfa05e16de6d4c07b
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f275016ccf2 - rust_begin_unwind
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/panicking.rs:578:5
  17:     0x7f27501c6733 - core::panicking::panic_fmt::h93685670ab56dd24
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/core/src/panicking.rs:67:14
  18:     0x7f27501c6892 - core::panicking::panic_bounds_check::h65cb557e1c631581
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/core/src/panicking.rs:162:5
  19:     0x7f27513ef7e5 - <rustc_infer[1153db3b7b8455eb]::infer::equate::Equate as rustc_middle[19fc470caecc1d0b]::ty::relate::TypeRelation>::tys
  20:     0x7f275197cdd0 - <rustc_infer[1153db3b7b8455eb]::infer::at::At>::eq::<rustc_middle[19fc470caecc1d0b]::ty::Ty>
  21:     0x7f27535a25bd - <rustc_infer[1153db3b7b8455eb]::infer::InferCtxt>::can_eq::<rustc_middle[19fc470caecc1d0b]::ty::Ty>
  22:     0x7f275357dd04 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::suggest_derive
  23:     0x7f2753575d3b - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::report_no_match_method_error
  24:     0x7f27535861b1 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::report_method_error
  25:     0x7f27519760ff - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_expr_path
  26:     0x7f27515ce14a - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_call
  27:     0x7f27519411e1 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7f27519a2793 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_match::{closure#0}
  29:     0x7f2751942f30 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7f27519a1aa4 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_match::{closure#0}
  31:     0x7f2751942f30 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:     0x7f2751989030 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_block_with_expected
  33:     0x7f2751941a06 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7f2751ac6b16 - <rustc_hir_typeck[6152fdeaa7a91f83]::fn_ctxt::FnCtxt>::check_return_expr
  35:     0x7f2751abe78e - rustc_hir_typeck[6152fdeaa7a91f83]::check::check_fn
  36:     0x7f2751aa5eca - rustc_hir_typeck[6152fdeaa7a91f83]::typeck
  37:     0x7f2751a9ba32 - rustc_query_system[c860b345af5c56b4]::query::plumbing::try_execute_query::<rustc_query_impl[ad99806c25ea6d8b]::queries::typeck, rustc_query_impl[ad99806c25ea6d8b]::plumbing::QueryCtxt>
  38:     0x7f27523dfec3 - rustc_query_system[c860b345af5c56b4]::query::plumbing::try_execute_query::<rustc_query_impl[ad99806c25ea6d8b]::queries::used_trait_imports, rustc_query_impl[ad99806c25ea6d8b]::plumbing::QueryCtxt>
  39:     0x7f2752875249 - rustc_hir_analysis[16c92fce30167f2d]::check_crate
  40:     0x7f2752869510 - rustc_interface[ff8b699189ee875a]::passes::analysis
  41:     0x7f2752b5d6c7 - rustc_query_system[c860b345af5c56b4]::query::plumbing::try_execute_query::<rustc_query_impl[ad99806c25ea6d8b]::queries::analysis, rustc_query_impl[ad99806c25ea6d8b]::plumbing::QueryCtxt>
  42:     0x7f2752b5d3e3 - rustc_query_impl[ad99806c25ea6d8b]::get_query::analysis
  43:     0x7f27525e3e4f - <rustc_middle[19fc470caecc1d0b]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[7dd5276dc45ad99a]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>
  44:     0x7f27525e2f2f - <rustc_interface[ff8b699189ee875a]::interface::Compiler>::enter::<rustc_driver_impl[7dd5276dc45ad99a]::run_compiler::{closure#1}::{closure#2}, core[526631096a221252]::result::Result<core[526631096a221252]::option::Option<rustc_interface[ff8b699189ee875a]::queries::Linker>, rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>
  45:     0x7f27525e05bb - std[e68c9393bb7a5ebe]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ff8b699189ee875a]::util::run_in_thread_pool_with_globals<rustc_interface[ff8b699189ee875a]::interface::run_compiler<core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>, rustc_driver_impl[7dd5276dc45ad99a]::run_compiler::{closure#1}>::{closure#0}, core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>
  46:     0x7f27525dfd25 - <<std[e68c9393bb7a5ebe]::thread::Builder>::spawn_unchecked_<rustc_interface[ff8b699189ee875a]::util::run_in_thread_pool_with_globals<rustc_interface[ff8b699189ee875a]::interface::run_compiler<core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>, rustc_driver_impl[7dd5276dc45ad99a]::run_compiler::{closure#1}>::{closure#0}, core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[526631096a221252]::result::Result<(), rustc_span[b1588a228600fe8e]::ErrorGuaranteed>>::{closure#1} as core[526631096a221252]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7f27501776b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h477e9964257b8a6e
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/alloc/src/boxed.rs:1985:9
  48:     0x7f27501776b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc18f7ccf7c414d37
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/alloc/src/boxed.rs:1985:9
  49:     0x7f27501776b5 - std::sys::unix::thread::Thread::new::thread_start::h8f758672f4bd1a71
                               at /rustc/699a862a3d4e4a2d5603c93297c0c44021ea72f5/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7f274fed7bb5 - <unknown>
  51:     0x7f274ff59d90 - <unknown>
  52:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

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

note: rustc 1.71.0-nightly (699a862a3 2023-05-12) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `<impl at treereduce.out:3:1: 3:7>::constant_not`
#1 [used_trait_imports] finding used_trait_imports `<impl at treereduce.out:3:1: 3:7>::constant_not`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.

Metadata

Metadata

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions