rust-lang / rust-lang/rust

[ICE]: Instance::mono: DefId(0:3 ~ ice_min_repro[2fa7]::foo) has type parameters when building with Miri

Open
#154,385 1 comment 0 reactions 1 assignee View on GitHub

@HerrCai0907 is already working on this.

Since Mar 29, 2026.

A-miri A-name-mangling C-bug I-ICE T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

When building the code below with cargo miri test, the compiler produces the following error

Code
#[unsafe(no_mangle)]
fn foo<T: std::fmt::Debug>(value: T) {
    println!("{value:?}");
}
Meta

rustc --version --verbose:

rustc 1.96.0-nightly (fd0c901b0 2026-03-18)
binary: rustc
commit-hash: fd0c901b00ee1e08a250039cdb90258603497e20
commit-date: 2026-03-18
host: x86_64-pc-windows-msvc
release: 1.96.0-nightly
LLVM version: 22.1.0
Error output
error: internal compiler error: /rustc-dev/fd0c901b00ee1e08a250039cdb90258603497e20/compiler\rustc_middle\src\ty\instance.rs:458:17: Instance::mono: DefId(0:3 ~ ice_min_repro[2fa7]::foo) has type parameters
Backtrace

thread 'rustc' panicked at /rustc-dev/fd0c901b00ee1e08a250039cdb90258603497e20/compiler\rustc_middle\src\ty\instance.rs:458:17:
Box<dyn Any>
stack backtrace:
   0:     0x7ffe8a0cacae - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffe8a0cacae - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe8a0cacae - std::backtrace::Backtrace::create
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\backtrace.rs:331
   3:     0x7ffe8a0cabea - std::backtrace::Backtrace::force_capture
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\backtrace.rs:312
   4:     0x7ffe8b8b5409 - core[e8082310acd5b989]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[ecb82c43dc0b6007]::Level, &str), usize), <((rustc_lint_defs[ecb82c43dc0b6007]::Level, &str), usize) as core[e8082310acd5b989]::cmp::PartialOrd>::lt>
   5:     0x7ffe8a0dea24 - std::panicking::panic_with_hook
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\panicking.rs:833
   6:     0x7ffe8e078143 - core[e8082310acd5b989]::slice::sort::stable::quicksort::quicksort::<rustc_errors[444c0105aea6caf9]::annotate_snippet_emitter_writer::Annotation, <[rustc_errors[444c0105aea6caf9]::annotate_snippet_emitter_writer::Annotation]>::sort_by_key<usize, rustc_errors[444c0105aea6caf9]::annotate_snippet_emitter_writer::collect_annotations::{closure#2}>::{closure#0}>
   7:     0x7ffe8e070549 - std[68781d2d012a60d0]::sys::backtrace::__rust_end_short_backtrace::<std[68781d2d012a60d0]::panicking::begin_panic<rustc_errors[444c0105aea6caf9]::ExplicitBug>::{closure#0}, !>
   8:     0x7ffe8e06d9c8 - std[68781d2d012a60d0]::panicking::begin_panic::<rustc_errors[444c0105aea6caf9]::ExplicitBug>
   9:     0x7ffe8e0856d5 - <rustc_errors[444c0105aea6caf9]::diagnostic::BugAbort as rustc_errors[444c0105aea6caf9]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  10:     0x7ffe8df599e7 - <rustc_data_structures[4c5f9f02e597ed01]::profiling::SelfProfilerRef>::exec::cold_call::<<rustc_data_structures[4c5f9f02e597ed01]::profiling::SelfProfilerRef>::incr_result_hashing::{closure#0}>
  11:     0x7ffe8df59a75 - <rustc_data_structures[4c5f9f02e597ed01]::profiling::SelfProfilerRef>::exec::cold_call::<<rustc_data_structures[4c5f9f02e597ed01]::profiling::SelfProfilerRef>::incr_result_hashing::{closure#0}>
  12:     0x7ffe8df46276 - rustc_middle[76db7d767fe7a6dd]::util::bug::span_bug_fmt::<rustc_span[a92fa7ebee9fddee]::span_encoding::Span>
  13:     0x7ffe8df96786 - rustc_middle[76db7d767fe7a6dd]::util::bug::bug_fmt
  14:     0x7ffe8b67a882 - <hashbrown[ec495549107772b4]::raw::RawTable<usize>>::reserve_rehash::<indexmap[d30d657db8fcb2f1]::inner::get_hash<rustc_middle[76db7d767fe7a6dd]::middle::region::Scope, rustc_middle[76db7d767fe7a6dd]::middle::region::Scope>::{closure#0}>
  15:     0x7ffe8b6db518 - <rustc_middle[76db7d767fe7a6dd]::ty::instance::Instance>::mono
  16:     0x7ff6b00174b6 - <unknown>
  17:     0x7ff6b0131f54 - <unknown>
  18:     0x7ff6b00b80e6 - <unknown>
  19:     0x7ff6b0001860 - <unknown>
  20:     0x7ff6b0195d7c - <unknown>
  21:     0x7ff6b0134e6d - <unknown>
  22:     0x7ff6b0130c0c - <unknown>
  23:     0x7ff6b00892a2 - <unknown>
  24:     0x7ff6b0012329 - <unknown>
  25:     0x7ff6b00b2e8e - <unknown>
  26:     0x7ff6aff9202e - <unknown>
  27:     0x7ffe873dbaa5 - std[68781d2d012a60d0]::sys::backtrace::__rust_begin_short_backtrace::<std[68781d2d012a60d0]::thread::lifecycle::spawn_unchecked<ctrlc[fec3e3798385aa32]::set_handler_inner<rustc_driver_impl[2801a1d0af7dc0fc]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  28:     0x7ffe873d59f1 - RINvNtNtCs8Y5oIjIOpQ2_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCs373VuARm7TT_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs3qX5jVGyLmW_17rustc_driver_i
  29:     0x7ffe873e09da - std[68781d2d012a60d0]::sys::backtrace::__rust_begin_short_backtrace::<std[68781d2d012a60d0]::thread::lifecycle::spawn_unchecked<ctrlc[fec3e3798385aa32]::set_handler_inner<rustc_driver_impl[2801a1d0af7dc0fc]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  30:     0x7ffe8a0e866c - std::sys::thread::windows::impl$0::new::thread_start
                               at /rustc/fd0c901b00ee1e08a250039cdb90258603497e20/library\std\src\sys\thread\windows.rs:58
  31:     0x7fff2c05e8d7 - BaseThreadInitThunk
  32:     0x7fff2d6ec48c - RtlUserThreadStart

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.