8000
Skip to content

[ICE]: cannot decode AttrId with CacheDecoder #154878

@matthiaskrgr

Description

@matthiaskrgr

Code

pub fn main() {
    let x = 42.0;
    #[expect(invalid_nan_comparisons)]
    let _b = x == f32::NAN;
}

rustc ./file.rs -Cincremental=.

running this twice should trigger the ICE

Meta

rustc --version --verbose:

rustc 1.96.0-nightly (9602bda1d 2026-04-05)
binary: rustc
commit-hash: 9602bda1dd0c1bbf5787e398385bbac81fd532f8
commit-date: 2026-04-05
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2

Error output

<output>
Backtrace

thread 'rustc' (870554) panicked at /rustc-dev/c2efcc4ae006a6b2761cb42572fc9cee0d1ce4af/compiler/rustc_middle/src/query/on_disk_cache.rs:663:9:
cannot decode `AttrId` with `CacheDecoder`
stack backtrace:
   0:     0x7f2d869b66ab - <<std[8eed7d2a0d2e32a7]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[c3b3818c781903d6]::fmt::Display>::fmt
   1:     0x7f2d8701d748 - core[c3b3818c781903d6]::fmt::write
   2:     0x7f2d869cd976 - <std[8eed7d2a0d2e32a7]::sys::stdio::unix::Stderr as std[8eed7d2a0d2e32a7]::io::Write>::write_fmt
   3:     0x7f2d8698c9a8 - std[8eed7d2a0d2e32a7]::panicking::default_hook::{closure#0}
   4:     0x7f2d869a9d13 - std[8eed7d2a0d2e32a7]::panicking::default_hook
   5:     0x7f2d859b155c - std[8eed7d2a0d2e32a7]::panicking::update_hook::<alloc[f403ee7a715222b6]::boxed::Box<rustc_driver_impl[7e67e524f2e0558b]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f2d869a9ff2 - std[8eed7d2a0d2e32a7]::panicking::panic_with_hook
   7:     0x7f2d8698ca9a - std[8eed7d2a0d2e32a7]::panicking::panic_handler::{closure#0}
   8:     0x7f2d869837a9 - std[8eed7d2a0d2e32a7]::sys::backtrace::__rust_end_short_backtrace::<std[8eed7d2a0d2e32a7]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f2d8698e4cd - __rustc[1c0edf6a00b737dc]::rust_begin_unwind
  10:     0x7f2d83496bfc - core[c3b3818c781903d6]::panicking::panic_fmt
  11:     0x7f2d885344ed - <rustc_middle[165f22ec1c9787f3]::query::on_disk_cache::OnDiskCache>::load_side_effect
  12:     0x7f2d88535a4d - <rustc_query_impl[f409b05e3d872181]::dep_kind_vtables::non_query::SideEffect::{closure#0} as core[c3b3818c781903d6]::ops::function::FnOnce<(rustc_middle[165f22ec1c9787f3]::ty::context::TyCtxt, rustc_middle[165f22ec1c9787f3]::dep_graph::dep_node::DepNode, rustc_middle[165f22ec1c9787f3]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  13:     0x7f2d870b7874 - <rustc_middle[165f22ec1c9787f3]::dep_graph::graph::DepGraphData>::try_mark_previous_green
  14:     0x7f2d870b4a05 - <rustc_middle[165f22ec1c9787f3]::dep_graph::graph::DepGraph>::try_mark_green
  15:     0x7f2d870b484c - rustc_query_impl[f409b05e3d872181]::execution::ensure_can_skip_execution::<rustc_middle[165f22ec1c9787f3]::query::caches::DefaultCache<rustc_span[70fc2dc825ee8976]::def_id::LocalModDefId, rustc_middle[165f22ec1c9787f3]::query::erase::ErasedData<[u8; 0usize]>>>
  16:     0x7f2d87ffff2c - rustc_query_impl[f409b05e3d872181]::query_impl::lint_mod::execute_query_incr::__rust_end_short_backtrace
  17:     0x7f2d87fffa24 - rustc_lint[18575b0fd924e4b9]::late::check_crate::{closure#1}
  18:     0x7f2d87fff646 - rustc_lint[18575b0fd924e4b9]::late::check_crate
  19:     0x7f2d87ffed70 - rustc_interface[3d73cd67649ddf73]::passes::analysis::{closure#0}::{closure#0}::{closure#2}
  20:     0x7f2d87ffeb62 - rustc_data_structures[cae841260e08523c]::sync::parallel::par_fns
  21:     0x7f2d87ffeafc - rustc_interface[3d73cd67649ddf73]::passes::analysis::{closure#0}::{closure#0}
  22:     0x7f2d87ffeb62 - rustc_data_structures[cae841260e08523c]::sync::parallel::par_fns
  23:     0x7f2d870b8863 - rustc_interface[3d73cd67649ddf73]::passes::analysis
  24:     0x7f2d8859d73e - rustc_query_impl[f409b05e3d872181]::execution::try_execute_query::<rustc_middle[165f22ec1c9787f3]::query::caches::SingleCache<rustc_middle[165f22ec1c9787f3]::query::erase::ErasedData<[u8; 0usize]>>, true>
  25:     0x7f2d8859d0aa - rustc_query_impl[f409b05e3d872181]::query_impl::analysis::execute_query_incr::__rust_end_short_backtrace
  26:     0x7f2d8826c15e - rustc_interface[3d73cd67649ddf73]::interface::run_compiler::<(), rustc_driver_impl[7e67e524f2e0558b]::run_compiler::{closure#0}>::{closure#1}
  27:     0x7f2d8821a03e - std[8eed7d2a0d2e32a7]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[3d73cd67649ddf73]::util::run_in_thread_with_globals<rustc_interface[3d73cd67649ddf73]::util::run_in_thread_pool_with_globals<rustc_interface[3d73cd67649ddf73]::interface::run_compiler<(), rustc_driver_impl[7e67e524f2e0558b]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  28:     0x7f2d8821a8e0 - <std[8eed7d2a0d2e32a7]::thread::lifecycle::spawn_unchecked<rustc_interface[3d73cd67649ddf73]::util::run_in_thread_with_globals<rustc_interface[3d73cd67649ddf73]::util::run_in_thread_pool_with_globals<rustc_interface[3d73cd67649ddf73]::interface::run_compiler<(), rustc_driver_impl[7e67e524f2e0558b]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[c3b3818c781903d6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f2d8821b7ec - <std[8eed7d2a0d2e32a7]::sys::thread::unix::Thread>::new::thread_start
  30:     0x7f2d81ca597a - <unknown>
  31:     0x7f2d81d292bc - <unknown>
  32:                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: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/IM/rustc-ice-2026-04-06T10_05_15-870552.txt` to your bug report

note: rustc 1.96.0-nightly (c2efcc4ae 2026-04-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C incremental=[REDACTED]

query stack during panic:
#0 [analysis] running analysis passes on crate `file`
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 lint_mod(file[d10f])
end of try_mark_green dep node stack

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-prioritizeIssue: Indicates that prioritization has been requested for this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-untriagedUntriaged performance or correctness regression.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0