Skip to content

ICE: assertion failed: self.stashed_diagnostics.is_empty() #12364

Closed

Description

Summary

We run clippy checks as part of our CI workflow in the esp-hal project. We have been using the nightly release channel for various reasons, and this has largely not been a problem over the last couple of years.

As of yesterday (2024-02-26) this ICE has reared its head. I had expected this to be resolved with a new nightly release, as has usually been the case in the rare cases we encounter problems like this, however we are still experiencing this ICE.

The most recent workflow run (as of time of writing) can be seen failing here:
https://github.com/esp-rs/esp-hal/actions/runs/8066109592/job/22033416529

I apologize, I am unable to provide a minimal verifiable example at this time; if my schedule clears up this week perhaps I can look into it, but can't make any promises.

Version

rustc 1.78.0-nightly (fc3800f65 2024-02-26)
binary: rustc
commit-hash: fc3800f65777a365b5125706d60f97e4d0675efe
commit-date: 2024-02-26
host: x86_64-apple-darwin
release: 1.78.0-nightly
LLVM version: 18.1.0

Error output

Backtrace

thread '<unnamed>' panicked at compiler/rustc_errors/src/lib.rs:565:9:
assertion failed: self.stashed_diagnostics.is_empty()
stack backtrace:
 0: _rust_begin_unwind
 1: core::panicking::panic_fmt
 2: core::panicking::panic
 3: <rustc_errors::DiagCtxtInner as core::ops::drop::Drop>::drop
 4: core::ptr::drop_in_place::<rustc_errors::DiagCtxt>
 5: core::ptr::drop_in_place::<rustc_session::parse::ParseSess>
 6: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<clippy_lints::doc::needless_doctest_main::check::check_code_sample::{closure#0}::{closure#0}, (bool, alloc::vec::Vec<core::ops::range::Range<usize>>)>
 7: rustc_span::create_session_globals_then::<(bool, alloc::vec::Vec<core::ops::range::Range<usize>>), clippy_lints::doc::needless_doctest_main::check::check_code_sample::{closure#0}::{closure#0}>
 8: rustc_driver_impl::catch_fatal_errors::<clippy_lints::doc::needless_doctest_main::check::check_code_sample::{closure#0}, (bool, alloc::vec::Vec<core::ops::range::Range<usize>>)>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please attach the file at `/Users/jesse/Work/esp-hal/esp-hal/rustc-ice-2024-02-27T14_29_42-23311.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
note: Clippy version: clippy 0.1.78 (fc3800f6 2024-02-26)

thread 'rustc' panicked at src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs:125:10:
thread::spawn failed: Any { .. }
stack backtrace:
 0: _rust_begin_unwind
 1: core::panicking::panic_fmt
 2: core::result::unwrap_failed
 3: clippy_lints::doc::check_attrs
 4: <clippy_lints::doc::Documentation as rustc_lint::passes::LateLintPass>::check_item
 5: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
 6: rustc_lint::late::late_lint_crate
 7: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure#0}>>
 8: rustc_data_structures::sync::parallel::disabled::join::<rustc_lint::late::check_crate::{closure#0}, rustc_lint::late::check_crate::{closure#1}, (), ()>
 9: rustc_lint::late::check_crate
10: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#0}::{closure#1}::{closure#0}::{closure#3}::{closure#0}>>
11: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#0}::{closure#0}::{closure#2}>
12: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#0}>>
13: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#0}>
14: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#6}>
15: rustc_interface::passes::analysis
    [... omitted 2 frames ...]
16: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
17: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
18: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
19: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please attach the file at `/Users/jesse/Work/esp-hal/esp-hal/rustc-ice-2024-02-27T14_29_42-23311.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
note: Clippy version: clippy 0.1.78 (fc3800f6 2024-02-26)

error: could not compile `esp-hal` (lib)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions