Skip to content

[ICE]: rustdoc: collect_intra_doc_links: internal error: entered unreachable code #157204

@matthiaskrgr

Description

@matthiaskrgr

Code

struct MyStruct;
/// [Self::a::b]
pub type MyAlias = MyStruct;

fn main() {}

Meta

rustc --version --verbose:

rustdoc 1.98.0-nightly (c31589119 2026-05-31)
binary: rustdoc
commit-hash: c315891193c35827c2d789adce686f8a5481778f
commit-date: 2026-05-31
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Error output

<output>
Backtrace


thread 'rustc' (3912320) panicked at src/librustdoc/passes/collect_intra_doc_links.rs:331:26:
internal error: entered unreachable code
stack backtrace:
   0:     0x7f499c2a2b39 - <<std[101bcc562b039d88]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[34752699eafec3ec]::fmt::Display>::fmt
   1:     0x7f499ca2a548 - core[34752699eafec3ec]::fmt::write
   2:     0x7f499c2b9636 - <std[101bcc562b039d88]::sys::stdio::unix::Stderr as std[101bcc562b039d88]::io::Write>::write_fmt
   3:     0x7f499c278d5e - std[101bcc562b039d88]::panicking::default_hook::{closure#0}
   4:     0x7f499c296473 - std[101bcc562b039d88]::panicking::default_hook
   5:     0x7f499b092331 - std[101bcc562b039d88]::panicking::update_hook::<alloc[c8182525a12656f8]::boxed::Box<rustc_driver_impl[c9187ee63147f5a1]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f499c296752 - std[101bcc562b039d88]::panicking::panic_with_hook
   7:     0x7f499c278e54 - std[101bcc562b039d88]::panicking::panic_handler::{closure#0}
   8:     0x7f499c26d349 - std[101bcc562b039d88]::sys::backtrace::__rust_end_short_backtrace::<std[101bcc562b039d88]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f499c27a88d - __rustc[605069567983e01e]::rust_begin_unwind
  10:     0x7f4998d7442c - core[34752699eafec3ec]::panicking::panic_fmt
  11:     0x7f499971f7a2 - core[34752699eafec3ec]::panicking::panic
  12:     0x55b3492de68a - <rustdoc[3577eea8a6092771]::passes::collect_intra_doc_links::LinkCollector>::resolve
  13:     0x55b3492f695a - <rustdoc[3577eea8a6092771]::passes::collect_intra_doc_links::LinkCollector>::resolve_link
  14:     0x55b34924ebf6 - <rustdoc[3577eea8a6092771]::passes::collect_intra_doc_links::LinkCollector>::resolve_links::{closure#1}
  15:     0x55b34943e985 - <rustdoc[3577eea8a6092771]::passes::collect_intra_doc_links::LinkCollector as rustdoc[3577eea8a6092771]::visit::DocVisitor>::visit_item
  16:     0x55b34943efb9 - <rustdoc[3577eea8a6092771]::passes::collect_intra_doc_links::LinkCollector as rustdoc[3577eea8a6092771]::visit::DocVisitor>::visit_item
  17:     0x55b349328246 - rustdoc[3577eea8a6092771]::core::run_global_ctxt
  18:     0x55b34923c421 - rustdoc[3577eea8a6092771]::main_args::{closure#2}::{closure#0}
  19:     0x55b349233197 - rustc_interface[1d601d0d3d2ff64e]::interface::run_compiler::<(), rustdoc[3577eea8a6092771]::main_args::{closure#2}>::{closure#1}
  20:     0x55b349156416 - std[101bcc562b039d88]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[1d601d0d3d2ff64e]::util::run_in_thread_with_globals<rustc_interface[1d601d0d3d2ff64e]::util::run_in_thread_pool_with_globals<rustc_interface[1d601d0d3d2ff64e]::interface::run_compiler<(), rustdoc[3577eea8a6092771]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  21:     0x55b34927b0cd - <std[101bcc562b039d88]::thread::lifecycle::spawn_unchecked<rustc_interface[1d601d0d3d2ff64e]::util::run_in_thread_with_globals<rustc_interface[1d601d0d3d2ff64e]::util::run_in_thread_pool_with_globals<rustc_interface[1d601d0d3d2ff64e]::interface::run_compiler<(), rustdoc[3577eea8a6092771]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[34752699eafec3ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:     0x7f499db8cfac - <std[101bcc562b039d88]::sys::thread::unix::Thread>::new::thread_start
  23:     0x7f49970981b9 - <unknown>
  24:     0x7f499711d21c - <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: please attach the file at `/home/matthias/vcs/github/CRED/rustc-ice-2026-05-31T15_37_35-3912311.txt` to your bug report

note: rustc 1.98.0-nightly (f8a08b688 2026-05-30) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions