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

Compiler panicked unexpectedly on Option::unwrap() #92576

Closed
campbellC opened this issue Jan 5, 2022 · 3 comments
Closed

Compiler panicked unexpectedly on Option::unwrap() #92576

campbellC opened this issue Jan 5, 2022 · 3 comments
Labels
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

@campbellC
Copy link

Code

Propietary. I could spend some time on producing this if absolutely required. 

Meta

rustc --version --verbose:

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0

Error does not happen in 1.59.0-nightly (7d6f948 2022-01-04) or rust version 1.58.0-beta.2 (0e07bcb 2021-12-04).

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14

Backtrace

stack backtrace:
   0:     0x7fdcfbb75a9c - std::backtrace_rs::backtrace::libunwind::trace::hf6a6dfd7da937cb0
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fdcfbb75a9c - std::backtrace_rs::backtrace::trace_unsynchronized::hc596a19e4891f7f3
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fdcfbb75a9c - std::sys_common::backtrace::_print_fmt::hb16700db31584325
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fdcfbb75a9c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h231c4190cfa75162
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fdcfbbd2fdc - core::fmt::write::h2a1462b5f8eea807
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/fmt/mod.rs:1163:17
   5:     0x7fdcfbb65c05 - std::io::Write::write_fmt::h71ddfebc68685972
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/io/mod.rs:1696:15
   6:     0x7fdcfbb78f60 - std::sys_common::backtrace::_print::hcc197d4bebf2b369
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fdcfbb78f60 - std::sys_common::backtrace::print::h335a66af06738c7c
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fdcfbb78f60 - std::panicking::default_hook::{{closure}}::h6fac9ac9c8b79e52
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:210:50
   9:     0x7fdcfbb78b15 - std::panicking::default_hook::h341c1030c6a1161b
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:227:9
  10:     0x7fdcfc3652b1 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::h932547f60770f26a
  11:     0x7fdce43aba13 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9dd08cdcde8ff678
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1705:9
  12:     0x7fdce43c317d - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::he9808382f76bc09e
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fdcfbb79779 - std::panicking::rust_panic_with_hook::h50680ff4b44510c6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:628:17
  14:     0x7fdcfbb79202 - std::panicking::begin_panic_handler::{{closure}}::h9371c0fbb1e8465a
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:519:13
  15:     0x7fdcfbb75f44 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b3efa22a5768c0f
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:139:18
  16:     0x7fdcfbb79199 - rust_begin_unwind
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
  17:     0x7fdcfbb3d441 - core::panicking::panic_fmt::h23b9203e89cc61cf
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
  18:     0x7fdcfbb3d38d - core::panicking::panic::h0ba7146865b2f9d6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:50:5
  19:     0x7fdcfdb68b47 - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::hb925ab58899dddff
  20:     0x7fdcfded4b21 - rustc_middle::dep_graph::dep_node::<impl rustc_query_system::dep_graph::dep_node::DepNodeParams<rustc_middle::ty::context::TyCtxt> for rustc_span::def_id::LocalDefId>::recover::h2e76aa40aab4da19
  21:     0x7fdcfe55f52c - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::hc7fd02f51ac51090
  22:     0x7fdcfdb53d6a - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  23:     0x7fdcfdb53d41 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h14b50df9818693f3
  24:     0x7fdcfdab2234 - rustc_query_system::query::plumbing::ensure_must_run::h5874d260d5ffefca
  25:     0x7fdcfdb4d980 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_match::h8c5e24ac0041f639
  26:     0x7fdcfd56a9bc - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h291cf00004da9350
  27:     0x7fdcfd56ab75 - rustc_data_structures::sync::par_for_each_in::h399e0e884f8930a4
  28:     0x7fdcfdf9e4d4 - rustc_session::utils::<impl rustc_session::session::Session>::time::hcf657c3b1b60ef8c
  29:     0x7fdcfdf6f0c2 - rustc_interface::passes::analysis::h9fda1a8ae44d53e7
  30:     0x7fdcfe5893cf - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h26e86d963a73dec8
  31:     0x7fdcfe52e609 - rustc_data_structures::stack::ensure_sufficient_stack::h135baf7277c4d193
  32:     0x7fdcfe452a7b - rustc_query_system::query::plumbing::try_execute_query::h0bf7639d3f58bfbd
  33:     0x7fdcfe56b232 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::ha2144cf05b40d10d
  34:     0x7fdcfdf63ca9 - rustc_interface::passes::QueryContext::enter::h0523b23606206a0b
  35:     0x7fdcfdf4a977 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hf84cd18c24bd5171
  36:     0x7fdcfdf380ee - rustc_span::with_source_map::h6ab8a240e103b5b9
  37:     0x7fdcfdf4a2ac - scoped_tls::ScopedKey<T>::set::hd1fbd64c6f645895
  38:     0x7fdcfdf38ef5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0a1328c9fa7f7448
  39:     0x7fdcfdf64962 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4ea1ced06d6b3e97
  40:     0x7fdcfbb84933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7bd677a5dc988be6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
  41:     0x7fdcfbb84933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7b1c1ba11c4db785
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
  42:     0x7fdcfbb84933 - std::sys::unix::thread::Thread::new::thread_start::h9c58c0d12d84e854
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys/unix/thread.rs:106:17
  43:     0x7fdcfb8c217a - start_thread
  44:     0x7fdcfb1e5dc3 - clone
  45:                0x0 - <unknown>

``` query stack during panic: #0 [analysis] running analysis passes on this crate end of query stack ```

Strangely this worked after a cargo clean whilst I was trying to produce a minimal test case so I can no longer reproduce.

@campbellC campbellC 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 Jan 5, 2022
@Aaron1011
Copy link
Member

This should be fixed on the latest Nightly.

@campbellC
Copy link
Author

Yup confirmed that on both the latest beta and nightly I didn’t see the error.

@Aaron1011
Copy link
Member

Note that this is an incremental compilation issue - if it wasn't fixed, it could take several edit-compilr cycles to show up. However, this particular issue was fixed by #91924

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) ❄️ 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

3 participants