rust-lang / rust-lang/rust

panic when running rust clippy

Open
#144,302 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-incr-comp C-bug I-ICE S-needs-repro T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Summary

apologies that this is light on detail.

I was running cargo clippy inside oxc-project/oxc and found the following error

Version
rustc -Vv
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: aarch64-apple-darwin
release: 1.88.0
LLVM version: 20.1.5
Error output
cargo clippy
    Checking oxc_allocator v0.77.3 (/Users/cameron/github/Boshen/oxc/crates/oxc_allocator)
error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(oxc_allocator[9672]::generated::fixed_size_constants)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p oxc_allocator` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information


thread 'rustc' panicked at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/compiler/rustc_query_system/src/query/plumbing.rs:739:9:
Found unstable fingerprints for shallow_lint_levels_on(oxc_allocator[9672]::generated::fixed_size_constants): ShallowLintLevelMap { expectations: [(Stable { hir_id: HirId(DefId(0:1169 ~ oxc_allocator[9672]::generated::fixed_size_constants).0), attr_index: 0, lint_index: Some(0) }, LintExpectation { reason: None, emission_span: crates/oxc_allocator/src/generated/fixed_size_constants.rs:4:11: 4:37 (#0), is_unfulfilled_lint_expectations: false, lint_tool: Some("clippy") })], specs: {0: {LintId { lint: Lint { name: "clippy::UNREADABLE_LITERAL", default_level: Allow, desc: "long literal without underscores", edition_lint_opts: None, report_in_external_macro: true, future_incompatible: None, is_externally_loaded: true, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Expect, lint_id: Some(Stable { hir_id: HirId(DefId(0:1169 ~ oxc_allocator[9672]::generated::fixed_size_constants).0), attr_index: 0, lint_index: Some(0) }), src: Node { name: "clippy::unreadable_literal", span: crates/oxc_allocator/src/generated/fixed_size_constants.rs:4:11: 4:37 (#0), reason: None } }, LintId { lint: Lint { name: "DEAD_CODE", default_level: Warn, desc: "detect unused, unexported items", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Allow, lint_id: None, src: Node { name: "dead_code", span: crates/oxc_allocator/src/generated/fixed_size_constants.rs:5:10: 5:19 (#0), reason: None } }}} }
stack backtrace:
   0:        0x112fe57e4 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h2c3f7b4c4ce00f07
   1:        0x1105d5558 - core::fmt::write::h1dbafa36e52e01c5
   2:        0x112fda118 - std::io::Write::write_fmt::he72d49f3084ee601
   3:        0x112fe56a4 - std::sys::backtrace::BacktraceLock::print::h1fb87370474572ed
   4:        0x112fea360 - std::panicking::default_hook::{{closure}}::h195a9b2c829547eb
   5:        0x112fea030 - std::panicking::default_hook::h18c3aa3e3a3584d5
   6:        0x111140724 - std[72c7846bd0c5b2df]::panicking::update_hook::<alloc[546c5ff29fefb371]::boxed::Box<rustc_driver_impl[8a44d88c4f0f23]::install_ice_hook::{closure#1}>>::{closure#0}
   7:        0x112fead48 - std::panicking::rust_panic_with_hook::h02a9fa3cad928562
   8:        0x112fea93c - std::panicking::begin_panic_handler::{{closure}}::hd1cc56578f819958
   9:        0x112fe5c88 - std::sys::backtrace::__rust_end_short_backtrace::h52c1e479035e4bc4
  10:        0x112fea604 - __rustc[4794b31dd7191200]::rust_begin_unwind
  11:        0x115c2555c - core::panicking::panic_fmt::heec96bfc27e6c546
  12:        0x115cf2330 - rustc_query_system[e5df0f758f72467d]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[be4ece2d81dbf2e4]::ty::context::TyCtxt>
  13:        0x1125a0564 - rustc_query_system[e5df0f758f72467d]::query::plumbing::incremental_verify_ich::<rustc_middle[be4ece2d81dbf2e4]::ty::context::TyCtxt, rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>>
  14:        0x11259e980 - rustc_query_system[e5df0f758f72467d]::query::plumbing::try_execute_query::<rustc_query_impl[f2b4fd6c2e4cdec6]::DynamicConfig<rustc_data_structures[f8a49ce7c8670f7e]::vec_cache::VecCache<rustc_hir[9ba99a8cb2087a93]::hir_id::OwnerId, rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[e5df0f758f72467d]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt, true>
  15:        0x112754650 - rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::shallow_lint_levels_on::get_query_incr::__rust_end_short_backtrace
  16:        0x111d55dc4 - <rustc_middle[be4ece2d81dbf2e4]::ty::context::TyCtxt>::lint_level_at_node
  17:        0x1123d6788 - rustc_passes[2541d96bc89a543b]::dead::has_allow_dead_code_or_lang_attr
  18:        0x1123d6df4 - rustc_passes[2541d96bc89a543b]::dead::live_symbols_and_ignored_derived_traits
  19:        0x112742c30 - rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::live_symbols_and_ignored_derived_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>>
  20:        0x11251ef84 - rustc_query_system[e5df0f758f72467d]::query::plumbing::try_execute_query::<rustc_query_impl[f2b4fd6c2e4cdec6]::DynamicConfig<rustc_query_system[e5df0f758f72467d]::query::caches::SingleCache<rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt, true>
  21:        0x11273d01c - rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::force_from_dep_node::<rustc_query_impl[f2b4fd6c2e4cdec6]::DynamicConfig<rustc_query_system[e5df0f758f72467d]::query::caches::SingleCache<rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
  22:        0x1126cb714 - <rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::query_callback<rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::live_symbols_and_ignored_derived_traits::QueryType>::{closure#0} as core[27359fb985a9eb5]::ops::function::FnOnce<(rustc_middle[be4ece2d81dbf2e4]::ty::context::TyCtxt, rustc_query_system[e5df0f758f72467d]::dep_graph::dep_node::DepNode, rustc_query_system[e5df0f758f72467d]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  23:        0x1124c74c0 - <rustc_query_system[e5df0f758f72467d]::dep_graph::graph::DepGraphData<rustc_middle[be4ece2d81dbf2e4]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt>
  24:        0x1124c7298 - <rustc_query_system[e5df0f758f72467d]::dep_graph::graph::DepGraphData<rustc_middle[be4ece2d81dbf2e4]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt>
  25:        0x1124fc478 - rustc_query_system[e5df0f758f72467d]::query::plumbing::ensure_must_run::<rustc_query_impl[f2b4fd6c2e4cdec6]::DynamicConfig<rustc_query_system[e5df0f758f72467d]::query::caches::DefaultCache<rustc_span[93d1c13bb489426]::def_id::LocalModDefId, rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt>
  26:        0x112770724 - rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::check_mod_deathness::get_query_incr::__rust_end_short_backtrace
  27:        0x111a2d8bc - rustc_interface[3c49f4d970e728]::passes::analysis
  28:        0x112743118 - rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 0usize]>>
  29:        0x112514fbc - rustc_query_system[e5df0f758f72467d]::query::plumbing::try_execute_query::<rustc_query_impl[f2b4fd6c2e4cdec6]::DynamicConfig<rustc_query_system[e5df0f758f72467d]::query::caches::SingleCache<rustc_middle[be4ece2d81dbf2e4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f2b4fd6c2e4cdec6]::plumbing::QueryCtxt, true>
  30:        0x11274f25c - rustc_query_impl[f2b4fd6c2e4cdec6]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  31:        0x1110f1768 - rustc_interface[3c49f4d970e728]::passes::create_and_enter_global_ctxt::<core[27359fb985a9eb5]::option::Option<rustc_interface[3c49f4d970e728]::queries::Linker>, rustc_driver_impl[8a44d88c4f0f23]::run_compiler::{closure#0}::{closure#2}>
  32:        0x11113d524 - rustc_interface[3c49f4d970e728]::interface::run_compiler::<(), rustc_driver_impl[8a44d88c4f0f23]::run_compiler::{closure#0}>::{closure#1}
  33:        0x11112e47c - std[72c7846bd0c5b2df]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[3c49f4d970e728]::util::run_in_thread_with_globals<rustc_interface[3c49f4d970e728]::util::run_in_thread_pool_with_globals<rustc_interface[3c49f4d970e728]::interface::run_compiler<(), rustc_driver_impl[8a44d88c4f0f23]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:        0x111143ee0 - <<std[72c7846bd0c5b2df]::thread::Builder>::spawn_unchecked_<rustc_interface[3c49f4d970e728]::util::run_in_thread_with_globals<rustc_interface[3c49f4d970e728]::util::run_in_thread_pool_with_globals<rustc_interface[3c49f4d970e728]::interface::run_compiler<(), rustc_driver_impl[8a44d88c4f0f23]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[27359fb985a9eb5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:        0x112fed28c - std::sys::pal::unix::thread::Thread::new::thread_start::hf0cf67e969add794
  36:        0x185cdec0c - __pthread_cond_wait

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml

note: rustc 1.88.0 (6b00bc388 2025-06-23) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C incremental=[REDACTED] -C strip=debuginfo -C link-args=-Wl,-undefined,dynamic_lookup,-no_fixup_chains

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

query stack during panic:
#0 [shallow_lint_levels_on] looking up lint levels for `generated::fixed_size_constants`
rust-lang/rust-clippy#1 [live_symbols_and_ignored_derived_traits] finding live symbols in crate
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
note: Clippy version: clippy 0.1.88 (6b00bc3880 2025-06-23)

there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 check_mod_deathness(oxc_allocator[9672])
end of try_mark_green dep node stack
error: could not compile `oxc_allocator` (lib) due to 1 previous error

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report in oxc-project/oxc with Rust 1.88.0 by running cargo clippy, then try the suggested cargo clean -p oxc_allocator workaround. Start at compiler/rustc_query_system/src/query/plumbing.rs around incremental_verify_ich_failed and trace the shallow_lint_levels_on query for generated::fixed_size_constants. Done means determining the compiler cause and preventing this panic under the reported invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.