Skip to content

rustdoc: ICE: synthetic auto trait impls: unable to fulfill trait with unconditionally const bound #149281

@fmease

Description

@fmease
#![feature(const_trait_impl)]

pub struct Outer<T>(Inner<T>);
struct Inner<T>(T);

impl<T> Unpin for Inner<T>
where
    T: const std::default::Default,
{}
thread 'rustc' (4569) panicked at /rustc/c23ed3ef28b3cc30658310f771ddc66e5b687cf4/compiler/rustc_trait_selection/src/traits/auto_trait.rs:160:13:
Unable to fulfill trait DefId(2:38654 ~ core[b965]::marker::Unpin) for 'Outer<T/#0>': [TrueError]
thread 'rustc' (4632) panicked at /rustc/c23ed3ef28b3cc30658310f771ddc66e5b687cf4/compiler/rustc_trait_selection/src/traits/auto_trait.rs:160:13:
Unable to fulfill trait DefId(2:38654 ~ core[b965]::marker::Unpin) for 'Outer<T/#0>': [TrueError]
stack backtrace:
   0:     0x7f79c4c8d0c3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hf60079e6fb6edce2
   1:     0x7f79c54119c8 - core::fmt::write::h4556407225efd72f
   2:     0x7f79c4c42bf6 - std::io::Write::write_fmt::h0ea3249f5299861b
   3:     0x7f79c4c59dac - std::panicking::default_hook::{{closure}}::hdc04698b81fca7ef
   4:     0x7f79c4c59903 - std::panicking::default_hook::h4ae2716da9aa0620
   5:     0x7f79c3cde537 - std[ad4fd56af8a863a2]::panicking::update_hook::<alloc[689149252bbc5bc7]::boxed::Box<rustc_driver_impl[48d5ebda47e4f6c2]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f79c4c5a162 - std::panicking::panic_with_hook::h32ebcbf876d2754f
   7:     0x7f79c4c59ef8 - std::panicking::panic_handler::{{closure}}::h89279fddaaeed151
   8:     0x7f79c4c53f29 - std::sys::backtrace::__rust_end_short_backtrace::h1231c0eb8ad20f44
   9:     0x7f79c4c3521d - __rustc[d04359ab18481e3f]::rust_begin_unwind
  10:     0x7f79c1e62bdc - core::panicking::panic_fmt::h5575cb3abe0bc1c9
  11:     0x55c82418a462 - <rustc_trait_selection[9292ab8ee199358]::traits::auto_trait::AutoTraitFinder>::find_auto_trait_generics::<rustdoc[6004462a24d6e2c7]::clean::types::Generics, rustdoc[6004462a24d6e2c7]::clean::auto_trait::synthesize_auto_trait_impl::{closure#0}>
  12:     0x55c82448d323 - rustdoc[6004462a24d6e2c7]::clean::auto_trait::synthesize_auto_trait_impl
  13:     0x55c824493fc0 - rustdoc[6004462a24d6e2c7]::clean::utils::synthesize_auto_trait_and_blanket_impls
  14:     0x55c8244e54ec - <rustdoc[6004462a24d6e2c7]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[6004462a24d6e2c7]::visit::DocVisitor>::visit_item
  15:     0x55c8244e53e9 - <rustdoc[6004462a24d6e2c7]::passes::collect_trait_impls::SyntheticImplCollector as rustdoc[6004462a24d6e2c7]::visit::DocVisitor>::visit_item
  16:     0x55c8244a1674 - rustdoc[6004462a24d6e2c7]::passes::collect_trait_impls::collect_trait_impls
  17:     0x55c824446952 - rustdoc[6004462a24d6e2c7]::core::run_global_ctxt
  18:     0x55c82433a210 - rustdoc[6004462a24d6e2c7]::main_args::{closure#2}::{closure#0}
  19:     0x55c82433174b - rustc_interface[b4fbb2cc6bda294c]::interface::run_compiler::<(), rustdoc[6004462a24d6e2c7]::main_args::{closure#2}>::{closure#1}
  20:     0x55c8242823b8 - std[ad4fd56af8a863a2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[b4fbb2cc6bda294c]::util::run_in_thread_with_globals<rustc_interface[b4fbb2cc6bda294c]::util::run_in_thread_pool_with_globals<rustc_interface[b4fbb2cc6bda294c]::interface::run_compiler<(), rustdoc[6004462a24d6e2c7]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  21:     0x55c8243601bd - <<std[ad4fd56af8a863a2]::thread::Builder>::spawn_unchecked_<rustc_interface[b4fbb2cc6bda294c]::util::run_in_thread_with_globals<rustc_interface[b4fbb2cc6bda294c]::util::run_in_thread_pool_with_globals<rustc_interface[b4fbb2cc6bda294c]::interface::run_compiler<(), rustdoc[6004462a24d6e2c7]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[b965173db0298ed8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:     0x7f79c651e46f - std::sys::thread::unix::Thread::new::thread_start::hacdf6d1111221eb3
  23:     0x7f79bfe969cb - <unknown>
  24:     0x7f79bff1aa4c - <unknown>
  25:                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-rustdoc&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.93.0-nightly (c23ed3ef2 2025-11-23) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options

query stack during panic:
end of query stack
rustdoc 1.93.0-nightly (c23ed3ef2 2025-11-23)

Metadata

Metadata

Assignees

Labels

A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsC-bugCategory: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions