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

called Option::unwrap() on a None value, compiler/rustc_hir/src/definitions.rs:452 #7701

Closed
AlexApps99 opened this issue Sep 22, 2021 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@AlexApps99
Copy link

Code

I could not reproduce this error after cargo clean, so I can't create a minimum reproduction of the bug.
I can, however, provide the complete source, with /target/. I have zipped the directory while it's still reproducing the error.
I don't want to share my code unless necessary, so if this is not a duplicated error, or some sort of corruption from my end, let me know where to upload it, and I'll post the link here.
Here's the exact location where the unwrap happens in rustc:
https://github.com/rust-lang/rust/blob/5ecc8ad8462574354a55162a0c16b10eb95e3e70/compiler/rustc_hir/src/definitions.rs#L452

Meta

Rust version (rustc -Vv):

rustc 1.57.0-nightly (5ecc8ad84 2021-09-19)
binary: rustc
commit-hash: 5ecc8ad8462574354a55162a0c16b10eb95e3e70
commit-date: 2021-09-19
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

Error output

$ cargo clippy
    Checking chegwin v0.1.0 (/home/lxb/Desktop/cheg/chegwin)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/compiler/rustc_hir/src/definitions.rs:452:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.57 (5ecc8ad 2021-09-19)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `chegwin`
Backtrace

stack backtrace:
 0:     0x7f6f575ba51c - std::backtrace_rs::backtrace::libunwind::trace::h2ab374bc2a3b7023
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
 1:     0x7f6f575ba51c - std::backtrace_rs::backtrace::trace_unsynchronized::h128cb5178b04dc46
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7f6f575ba51c - std::sys_common::backtrace::_print_fmt::h5344f9eefca2041f
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys_common/backtrace.rs:67:5
 3:     0x7f6f575ba51c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h213003bc5c7acf04
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys_common/backtrace.rs:46:22
 4:     0x7f6f576187dc - core::fmt::write::h78bf85fc3e93663f
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/core/src/fmt/mod.rs:1126:17
 5:     0x7f6f575ab405 - std::io::Write::write_fmt::he619515c888f21a5
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/io/mod.rs:1667:15
 6:     0x7f6f575bda80 - std::sys_common::backtrace::_print::hf706674f77848203
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys_common/backtrace.rs:49:5
 7:     0x7f6f575bda80 - std::sys_common::backtrace::print::hf0b6c7a88804ec56
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys_common/backtrace.rs:36:9
 8:     0x7f6f575bda80 - std::panicking::default_hook::{{closure}}::h2dde766cd83a333a
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/panicking.rs:210:50
 9:     0x7f6f575bd637 - std::panicking::default_hook::h501e3b2e134eb149
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/panicking.rs:227:9
10:     0x564596d18979 - clippy_driver::ICE_HOOK::{{closure}}::{{closure}}::hfd0d270ef79012c7
11:     0x7f6f575be299 - std::panicking::rust_panic_with_hook::hc09e869c4cf00885
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/panicking.rs:628:17
12:     0x7f6f575bdd22 - std::panicking::begin_panic_handler::{{closure}}::hc2c6d70142458fc8
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/panicking.rs:519:13
13:     0x7f6f575ba9c4 - std::sys_common::backtrace::__rust_end_short_backtrace::had58f7c459a1cd6e
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys_common/backtrace.rs:141:18
14:     0x7f6f575bdcb9 - rust_begin_unwind
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/panicking.rs:517:5
15:     0x7f6f57583861 - core::panicking::panic_fmt::hf443e5eeb6cc9eab
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/core/src/panicking.rs:103:14
16:     0x7f6f575837ad - core::panicking::panic::h50b51d19800453c0
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/core/src/panicking.rs:50:5
17:     0x7f6f595658ec - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::h563e07c21e2d5321
18:     0x7f6f59856191 - 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::h0ca6fa6037e448bd
19:     0x7f6f59fe015c - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::hfd74f4aca31f1308
20:     0x7f6f595506ba - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hafaeeec7f9f1be08
21:     0x7f6f59550691 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hafaeeec7f9f1be08
22:     0x7f6f59550691 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hafaeeec7f9f1be08
23:     0x7f6f59550691 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hafaeeec7f9f1be08
24:     0x7f6f594b1b85 - rustc_query_system::query::plumbing::ensure_must_run::h83d3121e64c1ddeb
25:     0x7f6f59f55870 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::coherent_trait::h595c249b1730048c
26:     0x7f6f5910f014 - rustc_session::session::Session::track_errors::hc49e61c21ebcb56b
27:     0x7f6f59c990d8 - rustc_typeck::check_crate::hbc31e75563cc44a1
28:     0x7f6f59966903 - rustc_interface::passes::analysis::h0951ee04d0dbaea1
29:     0x7f6f59f9d1df - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::he6cddbcc44b80596
30:     0x7f6f59f19c49 - rustc_data_structures::stack::ensure_sufficient_stack::h6f4bc2e7c3e05f28
31:     0x7f6f59e41c95 - rustc_query_system::query::plumbing::try_execute_query::h2f6e06baffd11aa2
32:     0x7f6f59f53672 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::h84c389e5594a66cf
33:     0x7f6f5995d6f7 - rustc_interface::passes::QueryContext::enter::he530b51057ef4a01
34:     0x7f6f59944b01 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h964ff95d41ec01b8
35:     0x7f6f59931ffc - rustc_span::with_source_map::h43cbd8428809207d
36:     0x7f6f59944438 - scoped_tls::ScopedKey<T>::set::h3d900268035b2b22
37:     0x7f6f5993305a - std::sys_common::backtrace::__rust_begin_short_backtrace::hb43f082e4793abcc
38:     0x7f6f599308c5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hbb1067ee904c2726
39:     0x7f6f575cae33 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h59eef3b9c8a82350
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/alloc/src/boxed.rs:1636:9
40:     0x7f6f575cae33 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb5bbe017c347469c
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/alloc/src/boxed.rs:1636:9
41:     0x7f6f575cae33 - std::sys::unix::thread::Thread::new::thread_start::h62931528f61e35f5
                             at /rustc/5ecc8ad8462574354a55162a0c16b10eb95e3e70/library/std/src/sys/unix/thread.rs:106:17
42:     0x7f6f574d4259 - start_thread
43:     0x7f6f572b75e3 - __GI___clone
44:                0x0 - <unknown>

@AlexApps99 AlexApps99 added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Sep 22, 2021
@giraffate
Copy link
Contributor

Thanks for the report!

This might be duplicate as rust-lang/rust#89260. And it seems to be rustc issue, not Clippy.

@AlexApps99
Copy link
Author

I'll close this in favor of rust-lang/rust#89260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants