rust-lang / rust-lang/rust

[ICE]: rustdoc `None` in src/librustdoc/clean/mod.rs

Open
#151,511 2 comments 0 reactions 1 assignee View on GitHub

@cachebag is already working on this.

Since Jan 26, 2026.

C-bug F-adt_const_params F-generic_const_parameter_types F-min_generic_const_args F-unsized_const_params I-ICE T-compiler T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Code
// Regression test for issue #118040.
// Ensure that we support assoc const eq bounds where the assoc const comes from a supertrait.

//@ check-pass

#![feature(
    min_generic_const_args,
    adt_const_params,
    unsized_const_params,
    generic_const_parameter_types,
)]
#![allow(incomplete_features)]

use std::marker::ConstParamTy_;

trait Trait: SuperTrait {}
trait SuperTrait: SuperSuperTrait<i32> {}
trait SuperSuperTrait<T: ConstParamTy_> {
    #[type_const]
    const K: T;
}

fn take(_: impl Trait<K = 0>) {}

fn main() {}
Meta

rustc --version --verbose:

rustc 1.95.0-nightly (eda76d9d1 2026-01-21)
binary: rustc
commit-hash: eda76d9d1d133effbf7facb28168fd78d75fd434
commit-date: 2026-01-21
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8
Error output
<output>
Backtrace

thread 'rustc' (2412322) panicked at src/librustdoc/clean/mod.rs:480:48:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7febf1bea7a3 - <<std[7feda60b202149c0]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[87884960dd474d61]::fmt::Display>::fmt
   1:     0x7febf2209716 - core[87884960dd474d61]::fmt::write
   2:     0x7febf1c01196 - <std[7feda60b202149c0]::sys::stdio::unix::Stderr as std[7feda60b202149c0]::io::Write>::write_fmt
   3:     0x7febf1bc07d8 - std[7feda60b202149c0]::panicking::default_hook::{closure#0}
   4:     0x7febf1bdded3 - std[7feda60b202149c0]::panicking::default_hook
   5:     0x7febf0be090a - std[7feda60b202149c0]::panicking::update_hook::<alloc[63a829e86c35caf5]::boxed::Box<rustc_driver_impl[abf2222e03429fae]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7febf1bde1b2 - std[7feda60b202149c0]::panicking::panic_with_hook
   7:     0x7febf1bc08ca - std[7feda60b202149c0]::panicking::panic_handler::{closure#0}
   8:     0x7febf1bb4d29 - std[7feda60b202149c0]::sys::backtrace::__rust_end_short_backtrace::<std[7feda60b202149c0]::panicking::panic_handler::{closure#0}, !>
   9:     0x7febf1bc236d - __rustc[4aa0cf85fea6adf3]::rust_begin_unwind
  10:     0x7febee6de66c - core[87884960dd474d61]::panicking::panic_fmt
  11:     0x7febee3ed462 - core[87884960dd474d61]::panicking::panic
  12:     0x7febeea69ba9 - core[87884960dd474d61]::option::unwrap_failed
  13:     0x55d7127266ca - rustdoc[20c70a4d35cfcaa7]::clean::clean_generic_args
  14:     0x55d7125dff88 - <thin_vec[25026ea85b9608db]::ThinVec<rustdoc[20c70a4d35cfcaa7]::clean::types::PathSegment> as core[87884960dd474d61]::iter::traits::collect::FromIterator<rustdoc[20c70a4d35cfcaa7]::clean::types::PathSegment>>::from_iter::<core[87884960dd474d61]::iter::adapters::map::Map<core[87884960dd474d61]::slice::iter::Iter<rustc_hir[a7f1c54e19f9a255]::hir::PathSegment>, rustdoc[20c70a4d35cfcaa7]::clean::clean_path::{closure#0}>>
  15:     0x55d712726c99 - rustdoc[20c70a4d35cfcaa7]::clean::clean_generic_bound
  16:     0x55d71272711e - rustdoc[20c70a4d35cfcaa7]::clean::clean_generic_param
  17:     0x55d7127dfdc8 - <core[87884960dd474d61]::iter::adapters::map::Map<core[87884960dd474d61]::iter::adapters::filter::Filter<core[87884960dd474d61]::slice::iter::Iter<rustc_hir[a7f1c54e19f9a255]::hir::GenericParam>, rustdoc[20c70a4d35cfcaa7]::clean::clean_generics::{closure#0}>, rustdoc[20c70a4d35cfcaa7]::clean::clean_generics::{closure#1}> as core[87884960dd474d61]::iter::traits::iterator::Iterator>::next
  18:     0x55d71271b195 - rustdoc[20c70a4d35cfcaa7]::clean::clean_generics
  19:     0x55d71271a9db - rustdoc[20c70a4d35cfcaa7]::clean::clean_function
  20:     0x55d71261dbb1 - rustdoc[20c70a4d35cfcaa7]::clean::clean_maybe_renamed_item::{closure#0}
  21:     0x55d7127229c0 - rustdoc[20c70a4d35cfcaa7]::clean::clean_doc_module
  22:     0x55d7127140a1 - rustdoc[20c70a4d35cfcaa7]::core::run_global_ctxt
  23:     0x55d7126062b5 - rustdoc[20c70a4d35cfcaa7]::main_args::{closure#2}::{closure#0}
  24:     0x55d7125fde03 - rustc_interface[f192bf4f08d1c592]::interface::run_compiler::<(), rustdoc[20c70a4d35cfcaa7]::main_args::{closure#2}>::{closure#1}
  25:     0x55d71253f058 - std[7feda60b202149c0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f192bf4f08d1c592]::util::run_in_thread_with_globals<rustc_interface[f192bf4f08d1c592]::util::run_in_thread_pool_with_globals<rustc_interface[f192bf4f08d1c592]::interface::run_compiler<(), rustdoc[20c70a4d35cfcaa7]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  26:     0x55d712635ce7 - <std[7feda60b202149c0]::thread::lifecycle::spawn_unchecked<rustc_interface[f192bf4f08d1c592]::util::run_in_thread_with_globals<rustc_interface[f192bf4f08d1c592]::util::run_in_thread_pool_with_globals<rustc_interface[f192bf4f08d1c592]::interface::run_compiler<(), rustdoc[20c70a4d35cfcaa7]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[87884960dd474d61]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:     0x7febf33db328 - <std[7feda60b202149c0]::sys::thread::unix::Thread>::new::thread_start
  28:     0x7febecc9698b - <unknown>
  29:     0x7febecd1a9cc - <unknown>
  30:                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: please attach the file at `/home/matthias/vcs/github/rust/tests/ui/rustc-ice-2026-01-22T21_00_36-2412305.txt` to your bug report

note: rustc 1.95.0-nightly (eda76d9d1 2026-01-21) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

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.