这是indexloc提供的服务,不要输入任何密码
Skip to content

Assertion failed: self.stashed_diagnostics.is_empty() #4698

@dtolnay

Description

@dtolnay

Panic in nightly-2025-11-17 that bisects to rust-lang/rust#148993.

# Cargo.toml

[package]
name = "repro"
version = "0.0.0"
edition = "2024"
publish = false
// src/main.rs

pub trait Trait {
    type Assoc: Assoc;
}

pub trait Assoc {}

fn main() {}

cargo +nightly-2025-11-17 miri setup && cargo +nightly-2025-11-17 miri run

thread 'rustc' (453720) panicked at compiler/rustc_errors/src/lib.rs:1788:9:
assertion failed: self.stashed_diagnostics.is_empty()
stack backtrace:
   0:     0x72f5d6935b33 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5ae4ae86875c00e9
   1:     0x72f5d7001d9c - core::fmt::write::he58289da8ad88ac4
   2:     0x72f5d68eb0b6 - std::io::Write::write_fmt::ha47e198308c7c52d
   3:     0x72f5d690233c - std::panicking::default_hook::{{closure}}::h6b3da92cff9dfda6
   4:     0x72f5d6901e93 - std::panicking::default_hook::hc2cfe13e40265481
   5:     0x72f5d593fbf7 - std[d45af2a1259e8800]::panicking::update_hook::<alloc[58b5be5fbc54de9e]::boxed::Box<rustc_driver_impl[d2f42e81b9c37b75]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x72f5d69026f2 - std::panicking::panic_with_hook::h2172996bacdba2d7
   7:     0x72f5d69024ba - std::panicking::panic_handler::{{closure}}::hc36cea0dc92c48aa
   8:     0x72f5d68fc3f9 - std::sys::backtrace::__rust_end_short_backtrace::hd4b38282c54e463b
   9:     0x72f5d68dd6dd - __rustc[f20bc1530c389e91]::rust_begin_unwind
  10:     0x72f5d389c23c - core::panicking::panic_fmt::hda6de8e6488d2e11
  11:     0x72f5d31b08c2 - core::panicking::panic::h961d00b971108021
  12:     0x72f5d80cf616 - <rustc_errors[c3fdbdd0639f3724]::DiagCtxtInner>::flush_delayed
  13:     0x72f5d80cf3ed - <rustc_errors[c3fdbdd0639f3724]::DiagCtxtHandle>::flush_delayed
  14:     0x5f432880f0d7 - <miri[4e9c49b669df4bd8]::MiriCompilerCalls as rustc_driver_impl[d2f42e81b9c37b75]::Callbacks>::after_analysis
  15:     0x72f5d833ebb3 - <rustc_interface[67c0c783642d6c76]::passes::create_and_enter_global_ctxt<core[7c9280adad8818af]::option::Option<rustc_interface[67c0c783642d6c76]::queries::Linker>, rustc_driver_impl[d2f42e81b9c37b75]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[7c9280adad8818af]::ops::function::FnOnce<(&rustc_session[54c87533a8d99824]::session::Session, rustc_middle[65c3dfc665d99b31]::ty::context::CurrentGcx, alloc[58b5be5fbc54de9e]::sync::Arc<rustc_data_structures[7b18bb195bd0e66b]::jobserver::Proxy>, &std[d45af2a1259e8800]::sync::once_lock::OnceLock<rustc_middle[65c3dfc665d99b31]::ty::context::GlobalCtxt>, &rustc_data_structures[7b18bb195bd0e66b]::sync::worker_local::WorkerLocal<rustc_middle[65c3dfc665d99b31]::arena::Arena>, &rustc_data_structures[7b18bb195bd0e66b]::sync::worker_local::WorkerLocal<rustc_hir[afdf7e16091c21f7]::Arena>, rustc_driver_impl[d2f42e81b9c37b75]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  16:     0x72f5d81d6105 - rustc_interface[67c0c783642d6c76]::interface::run_compiler::<(), rustc_driver_impl[d2f42e81b9c37b75]::run_compiler::{closure#0}>::{closure#1}
  17:     0x72f5d812afba - std[d45af2a1259e8800]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[67c0c783642d6c76]::util::run_in_thread_with_globals<rustc_interface[67c0c783642d6c76]::util::run_in_thread_pool_with_globals<rustc_interface[67c0c783642d6c76]::interface::run_compiler<(), rustc_driver_impl[d2f42e81b9c37b75]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  18:     0x72f5d812aca8 - <<std[d45af2a1259e8800]::thread::Builder>::spawn_unchecked_<rustc_interface[67c0c783642d6c76]::util::run_in_thread_with_globals<rustc_interface[67c0c783642d6c76]::util::run_in_thread_pool_with_globals<rustc_interface[67c0c783642d6c76]::interface::run_compiler<(), rustc_driver_impl[d2f42e81b9c37b75]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[7c9280adad8818af]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  19:     0x72f5d81309af - std::sys::thread::unix::Thread::new::thread_start::h544843a2b008d4a8
  20:     0x72f5d1a9caa4 - start_thread
                               at ./nptl/pthread_create.c:447:8
  21:     0x72f5d1b29c6c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  22:                0x0 - <unknown>

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

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

note: compiler flags: --crate-type bin -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

rustc --version --verbose

rustc 1.93.0-nightly (518b42830 2025-11-16)
binary: rustc
commit-hash: 518b428304e0008859cb1fd81d1ac20efb2a064a
commit-date: 2025-11-16
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions