Skip to content

internal compiler error: unexpected panic #8102

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

Closed
TonalidadeHidrica opened this issue Dec 9, 2021 · 3 comments
Closed

internal compiler error: unexpected panic #8102

TonalidadeHidrica opened this issue Dec 9, 2021 · 3 comments

Comments

@TonalidadeHidrica
Copy link

I'm reporting because an unexpected panic happened on running cargo clippy.
On the other hand, cargo check succeeds without a warning.

The problem is that, if I created a new git worktree (that is, made a exact copy of src/, rust-toolchain, Cargo.{toml, lock} but not of target), the error does not reproduce. So I'm not sure what is the appropriate next action.
Here are the code that is causing the error. Also I .tar.gz-ed the current worktree.
I'm now leaving the worktree as-is just in case, so I may respond any troubleshooting steps.

  • Versions
❯ rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)
❯ cargo --version
cargo 1.57.0 (b2e52d7ca 2021-10-21)
❯ export | grep RUST
RUSTC_WRAPPER /Users/username/.cargo/bin/sccache
RUST_BACKTRACE full
❯ 
cargo clippy
❯ cargo clippy
    Checking taiko-wiki-data-analysis v0.1.0 (/Users/username/dev/git/com/github/TonalidadeHidrica/taiko-wiki-data-analysis)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
   0:        0x105d70321 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4edbddd26fc45697
   1:        0x105dc14bb - core::fmt::write::h266c957f12b1655a
   2:        0x105d60d3a - std::io::Write::write_fmt::h65d4ee621e8d810d
   3:        0x105d73585 - std::panicking::default_hook::{{closure}}::h5b4886cd9f93dfca
   4:        0x105d7316f - std::panicking::default_hook::h986d152c7bd7e732
   5:        0x1055aa808 - clippy_driver::ICE_HOOK::{{closure}}::{{closure}}::h3f14c4c90400f63b
   6:        0x105d73dc6 - std::panicking::rust_panic_with_hook::h151f3b3bf37b4f17
   7:        0x105d73814 - std::panicking::begin_panic_handler::{{closure}}::hf6660086d9ebd48c
   8:        0x105d70797 - std::sys_common::backtrace::__rust_end_short_backtrace::h34152178ea368a9a
   9:        0x105d737aa - _rust_begin_unwind
  10:        0x105dec05f - core::panicking::panic_fmt::hb64a2db862b4aca0
  11:        0x105debfb7 - core::panicking::panic::h709f8bbcee9c47c1
  12:        0x1109f6fba - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::hb730d16bcb9182b2
  13:        0x11163a49c - 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::hffc4e6a0830f2648
  14:        0x1108eabe0 - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::h1e753a243eb0fce7
  15:        0x11095ea79 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  16:        0x11095ea50 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  17:        0x11091ebeb - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green::h29c934006e707d96
  18:        0x1106770e8 - rustc_query_system::query::plumbing::ensure_must_run::h34a07367d359ac53
  19:        0x11090c17b - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_item_types::h7207284889faf16e
  20:        0x10fcd0ed7 - rustc_middle::hir::map::Map::for_each_module::hc3d31f925f1e5a38
  21:        0x10fbf8ded - rustc_typeck::check_crate::h639646483ad1f67a
  22:        0x10d2b619f - rustc_interface::passes::analysis::h4f85fbb562aaa2d0
  23:        0x11096b1d8 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h250cbf125cf5c5da
  24:        0x11088d5d5 - rustc_data_structures::stack::ensure_sufficient_stack::h6bf2db115705a40c
  25:        0x11075248c - rustc_query_system::query::plumbing::try_execute_query::hea85233fa9cc2fd4
  26:        0x1109080c5 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::hda9a7d1ffac3bca0
  27:        0x10d1f5211 - rustc_interface::passes::QueryContext::enter::hca7a6b48fcdfcc9c
  28:        0x10d1d3be6 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h5dd0e3e5d157764e
  29:        0x10d1a420e - rustc_span::with_source_map::h5222a0af0f8eb603
  30:        0x10d1d23ac - scoped_tls::ScopedKey<T>::set::h1d3d67352154478d
  31:        0x10d1a8c32 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb945015c1b1cd51d
  32:        0x10d1fa9a5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc43c9a06b1d9c32a
  33:        0x105d7dba7 - std::sys::unix::thread::Thread::new::thread_start::h1ebadf8a3a1817e4
  34:     0x7fff204268fc - __pthread_start

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 (f1edd042 2021-11-29)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `taiko-wiki-data-analysis`
cargo check
❯ cargo check
    Checking taiko-wiki-data-analysis v0.1.0 (/Users/username/dev/git/com/github/TonalidadeHidrica/taiko-wiki-data-analysis)
error[E0271]: type mismatch resolving `<FlatMap<std::option::Iter<'_, TwoStr<'_>>, TwoStrIter<'_>, [closure@src/pukiwiki_parser/inline.rs:605:70: 605:87]> as Iterator>::Item == Cow<'_, str>`
   --> src/pukiwiki_parser/inline.rs:602:27
    |
602 |     pub fn text(&self) -> impl Iterator<Item = Cow<str>> {
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Cow`, found `&str`
    |
    = note:   expected enum `Cow<'_, str>`
            found reference `&str`
note: required because of the requirements on the impl of `Iterator` for `__Enum9216455845793451550<impl Iterator, FlatMap<std::option::Iter<'_, TwoStr<'_>>, TwoStrIter<'_>, [closure@src/pukiwiki_parser/inline.rs:605:70: 605:87]>, std::iter::Empty<Cow<'_, str>>>`
   --> src/pukiwiki_parser/inline.rs:601:5
    |
601 |     #[auto_enum(Iterator)]
    |     ^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the attribute macro `auto_enum` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0271`.
error: could not compile `taiko-wiki-data-analysis` due to previous error
@dswij
Copy link
Member

dswij commented Dec 9, 2021

It looks like this is similar to #8095, happens on compiler/rustc_hir/src/definitions.rs:452:14

@TonalidadeHidrica
Copy link
Author

@dswij It seems so, and #8095 seems to be similar to #7927, which in turn to rust-lang/rust#89962. With so many similar issues, should I close this issue?

@dswij
Copy link
Member

dswij commented Dec 9, 2021

I think we can close this issue, but it's also good to know that the issue is common

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants