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 when compiling #126189

Closed
Voker57 opened this issue Jun 9, 2024 · 5 comments
Closed

ICE when compiling #126189

Voker57 opened this issue Jun 9, 2024 · 5 comments
Labels
A-HIR Area: The high-level intermediate representation (HIR) 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.

Comments

@Voker57
Copy link

Voker57 commented Jun 9, 2024

Code

https://gitlab.com/rustorion/rustorion/-/commits/rustcbug

Meta

rustc --version --verbose:

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-unknown-linux-gnu
release: 1.78.0
LLVM version: 18.1.2

Error output

thread 'rustc' panicked at compiler/rustc_hir_typeck/src/demand.rs:403:52:
index out of bounds: the len is 2 but the index is 2
stack backtrace:
   0:     0x7f7d863ed892 - std::backtrace_rs::backtrace::libunwind::trace::he4ee80166a02c846
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f7d863ed892 - std::backtrace_rs::backtrace::trace_unsynchronized::h476faccf57e88641
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7d863ed892 - std::sys_common::backtrace::_print_fmt::h430c922a77e7a59c
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f7d863ed892 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f7d8643ea6c - core::fmt::rt::Argument::fmt::hf3df69369399bfa9
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
   5:     0x7f7d8643ea6c - core::fmt::write::hd9a8d7d029f9ea1a
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1153:17
   6:     0x7f7d863e278f - std::io::Write::write_fmt::h0e1226b2b8d973fe
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
   7:     0x7f7d863ed664 - std::sys_common::backtrace::_print::hd2df4a083f6e69b8
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f7d863ed664 - std::sys_common::backtrace::print::he907f6ad7eee41cb
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f7d863f035b - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
  10:     0x7f7d863f00b3 - std::panicking::default_hook::h25ba2457dea68e65
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:292:9
  11:     0x7f7d8302845d - std[e4dfbc2c3f4b09f1]::panicking::update_hook::<alloc[1adba907b9db1888]::boxed::Box<rustc_driver_impl[24a943716c49befe]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f7d863f0ac0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h022ca2c0d8c21c9e
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2034:9
  13:     0x7f7d863f0ac0 - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:783:13
  14:     0x7f7d863f0802 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:657:13
  15:     0x7f7d863edd66 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f7d863f0534 - rust_begin_unwind
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
  17:     0x7f7d8643af85 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
  18:     0x7f7d8643b1d2 - core::panicking::panic_bounds_check::h9bb22f08a42e1ac8
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:209:5
  19:     0x7f7d83199e41 - <core[836963c7c1decc11]::slice::iter::Iter<&rustc_hir[33aca5c26ba91407]::hir::Expr> as core[836963c7c1decc11]::iter::traits::iterator::Iterator>::find_map::<rustc_middle[fda44fdb505d3e7f]::ty::Ty, <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::note_source_of_type_mismatch_constraint::{closure#3}>
  20:     0x7f7d831e351e - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::note_source_of_type_mismatch_constraint
  21:     0x7f7d831f7907 - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::report_arg_errors
  22:     0x7f7d811bdece - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_method_argument_types
  23:     0x7f7d84c7261b - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24:     0x7f7d84c6d68e - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_block_with_expected
  25:     0x7f7d84c7220c - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7f7d84c65bca - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_match
  27:     0x7f7d84c737be - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7f7d84c6e5eb - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_block_with_expected
  29:     0x7f7d84c7646f - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:     0x7f7d84c65bca - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_match
  31:     0x7f7d84c737be - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:     0x7f7d84c74276 - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7f7d84c6e5eb - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_block_with_expected
  34:     0x7f7d84c7220c - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  35:     0x7f7d84c65bca - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_match
  36:     0x7f7d84c737be - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:     0x7f7d84c6e5eb - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_block_with_expected
  38:     0x7f7d84c7646f - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7f7d84c65bca - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_match
  40:     0x7f7d84c737be - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  41:     0x7f7d84c74276 - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42:     0x7f7d84c6e5eb - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_block_with_expected
  43:     0x7f7d84c7220c - <rustc_hir_typeck[bd9e9ef04feb2a99]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:     0x7f7d849c980a - rustc_hir_typeck[bd9e9ef04feb2a99]::check::check_fn
  45:     0x7f7d849bf6b7 - rustc_hir_typeck[bd9e9ef04feb2a99]::typeck
  46:     0x7f7d849be90b - rustc_query_impl[e4152ad88c3d6c78]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e4152ad88c3d6c78]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 8usize]>>
  47:     0x7f7d8433ffd5 - rustc_query_system[475239fef39bf53f]::query::plumbing::try_execute_query::<rustc_query_impl[e4152ad88c3d6c78]::DynamicConfig<rustc_query_system[475239fef39bf53f]::query::caches::VecCache<rustc_span[a4517f2b2e65298c]::def_id::LocalDefId, rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e4152ad88c3d6c78]::plumbing::QueryCtxt, true>
  48:     0x7f7d8433d009 - rustc_query_impl[e4152ad88c3d6c78]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  49:     0x7f7d8433b995 - rustc_hir_analysis[7e49c3c0c7bed18]::check_crate
  50:     0x7f7d84b11ef2 - rustc_interface[ba2b6dc4c96cb491]::passes::analysis
  51:     0x7f7d84b118e5 - rustc_query_impl[e4152ad88c3d6c78]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e4152ad88c3d6c78]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 1usize]>>
  52:     0x7f7d8509d375 - rustc_query_system[475239fef39bf53f]::query::plumbing::try_execute_query::<rustc_query_impl[e4152ad88c3d6c78]::DynamicConfig<rustc_query_system[475239fef39bf53f]::query::caches::SingleCache<rustc_middle[fda44fdb505d3e7f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e4152ad88c3d6c78]::plumbing::QueryCtxt, true>
  53:     0x7f7d8509cf9c - rustc_query_impl[e4152ad88c3d6c78]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  54:     0x7f7d84dfc814 - rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler::<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}
  55:     0x7f7d8513eb6e - std[e4dfbc2c3f4b09f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>
  56:     0x7f7d8513e9ca - <<std[e4dfbc2c3f4b09f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#1} as core[836963c7c1decc11]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  57:     0x7f7d863fa145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h19b9e642d37e7272
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  58:     0x7f7d863fa145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h97265befc434d3ae
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  59:     0x7f7d863fa145 - std::sys::pal::unix::thread::Thread::new::thread_start::h420dad5cf01a9f35
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys/pal/unix/thread.rs:108:17
  60:     0x7f7d86198dbb - start_thread
                               at ./nptl/pthread_create.c:444:8
  61:     0x7f7d8621a9f8 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
  62:                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.78.0 (9b00956e5 2024-04-29) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `universe::<impl at rustorion/src/universe.rs:389:1: 389:14>::calculate_trading_parents`
#1 [analysis] running analysis passes on this crate
end of query stack

Backtrace

<backtrace>

@Voker57 Voker57 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 Jun 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 9, 2024
@Voker57
Copy link
Author

Voker57 commented Jun 9, 2024

not reproducible in the nightly

@theemathas
Copy link
Contributor

theemathas commented Jun 9, 2024

Presumably fixed by #126068, given the several issues with similar "index out of bounds" symptoms.

Edit: Maybe it's a different issue, given that the error occurred on a stable release?

@lqd
Copy link
Member

lqd commented Jun 9, 2024

No it's more a dupe of #118185, and thus fixed by #124227.

@veera-sivarajan
Copy link
Contributor

@rustbot label +A-hir -needs-triage

@rustbot rustbot added A-HIR Area: The high-level intermediate representation (HIR) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 9, 2024
@lqd
Copy link
Member

lqd commented Jun 9, 2024

Since it's already fixed on nightly since a month or so, I'm not sure it's necessary to track this anymore. I'll close this issue as a duplicate. The fix will land on stable in 1.80, in roughly 6 weeks.

Thanks for opening an issue.

@lqd lqd closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-HIR Area: The high-level intermediate representation (HIR) 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.
Projects
None yet
Development

No branches or pull requests

5 participants