Skip to content

[ICE]: no resolutions for a doc link #158745

Description

@matthiaskrgr

Code

mod bar { pub struct A; }
#[deprecated(note = "[std::io::ErrorKind::NotFound]")]
pub use bar::A;
#[doc(inline)]
pub use A as X;

fn main() {}

Meta

rustc --version --verbose:

rustdoc 1.98.0-nightly (c397dae80 2026-07-02)
binary: rustdoc
commit-hash: c397dae808f70caebab1fc4e11b3edf7e59f58c7
commit-date: 2026-07-02
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.8

Error output

<output>
Backtrace

error: internal compiler error: /rustc-dev/c397dae808f70caebab1fc4e11b3edf7e59f58c7/compiler/rustc_metadata/src/rmeta/encoder.rs:2599:36: no resolutions for a doc link
 --> code.rs:1:1
  |
1 | mod bar { pub struct A; }
  | ^^^^^^^


thread 'rustc' (2520021) panicked at /rustc-dev/c397dae808f70caebab1fc4e11b3edf7e59f58c7/compiler/rustc_metadata/src/rmeta/encoder.rs:2599:36:
Box<dyn Any>
stack backtrace:
   0:     0x7fb2d18f0836 - <<std[9825f2e6b8e19478]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[98665f3f32c5c4a4]::fmt::Display>::fmt
   1:     0x7fb2d200ec9e - core[98665f3f32c5c4a4]::fmt::write
   2:     0x7fb2d1905c1c - <std[9825f2e6b8e19478]::sys::stdio::unix::Stderr as std[9825f2e6b8e19478]::io::Write>::write_fmt
   3:     0x7fb2d18c4c9a - std[9825f2e6b8e19478]::panicking::default_hook::{closure#0}
   4:     0x7fb2d18e2f83 - std[9825f2e6b8e19478]::panicking::default_hook
   5:     0x7fb2d08cf4d8 - std[9825f2e6b8e19478]::panicking::update_hook::<alloc[c330bc42d7fbe3f9]::boxed::Box<rustc_driver_impl[86b904b42ab60ec6]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fb2d18e3422 - std[9825f2e6b8e19478]::panicking::panic_with_hook
   7:     0x7fb2d08fc941 - std[9825f2e6b8e19478]::panicking::begin_panic::<rustc_errors[2062bb0638bd9044]::ExplicitBug>::{closure#0}
   8:     0x7fb2d08f5826 - std[9825f2e6b8e19478]::sys::backtrace::__rust_end_short_backtrace::<std[9825f2e6b8e19478]::panicking::begin_panic<rustc_errors[2062bb0638bd9044]::ExplicitBug>::{closure#0}, !>
   9:     0x7fb2d08f36f7 - std[9825f2e6b8e19478]::panicking::begin_panic::<rustc_errors[2062bb0638bd9044]::ExplicitBug>
  10:     0x7fb2d0907ad1 - <rustc_errors[2062bb0638bd9044]::diagnostic::BugAbort as rustc_errors[2062bb0638bd9044]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7fb2d0e53f7c - <rustc_errors[2062bb0638bd9044]::DiagCtxtHandle>::span_bug::<rustc_span[92f9b61efdf79936]::span_encoding::Span, alloc[c330bc42d7fbe3f9]::string::String>
  12:     0x7fb2d0e830b6 - rustc_middle[88f8ef47a2d07faa]::util::bug::opt_span_bug_fmt::<rustc_span[92f9b61efdf79936]::span_encoding::Span>::{closure#0}
  13:     0x7fb2d0e83242 - rustc_middle[88f8ef47a2d07faa]::ty::context::tls::with_opt::<rustc_middle[88f8ef47a2d07faa]::util::bug::opt_span_bug_fmt<rustc_span[92f9b61efdf79936]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7fb2d0e6e98b - rustc_middle[88f8ef47a2d07faa]::ty::context::tls::with_context_opt::<rustc_middle[88f8ef47a2d07faa]::ty::context::tls::with_opt<rustc_middle[88f8ef47a2d07faa]::util::bug::opt_span_bug_fmt<rustc_span[92f9b61efdf79936]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7fb2ce889b98 - rustc_middle[88f8ef47a2d07faa]::util::bug::span_bug_fmt::<rustc_span[92f9b61efdf79936]::span_encoding::Span>
  16:     0x7fb2d0e4f765 - <rustc_metadata[c70ebc065071b356]::rmeta::encoder::provide::{closure#0} as core[98665f3f32c5c4a4]::ops::function::FnOnce<(rustc_middle[88f8ef47a2d07faa]::ty::context::TyCtxt, rustc_span[92f9b61efdf79936]::def_id::LocalDefId)>>::call_once
  17:     0x7fb2d136ab63 - rustc_query_impl[f65037dd5affda9e]::query_impl::doc_link_resolutions::invoke_provider_fn::__rust_begin_short_backtrace
  18:     0x7fb2d2052b8d - rustc_query_impl[f65037dd5affda9e]::execution::try_execute_query::<rustc_middle[88f8ef47a2d07faa]::query::caches::DefIdCache<rustc_middle[88f8ef47a2d07faa]::query::erase::ErasedData<[u8; 8usize]>>, false>
  19:     0x7fb2d136abd2 - rustc_query_impl[f65037dd5affda9e]::query_impl::doc_link_resolutions::execute_query_non_incr::__rust_end_short_backtrace
  20:     0x563cc3d2638b - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  21:     0x563cc3d26f84 - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector>::resolve
  22:     0x563cc3d3c4d6 - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector>::resolve_link
  23:     0x563cc3caf2d6 - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector>::resolve_links::{closure#1}
  24:     0x563cc3e74c46 - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector as rustdoc[38c28cc48e8471ca]::visit::DocVisitor>::visit_item
  25:     0x563cc3e75049 - <rustdoc[38c28cc48e8471ca]::passes::collect_intra_doc_links::LinkCollector as rustdoc[38c28cc48e8471ca]::visit::DocVisitor>::visit_item
  26:     0x563cc3d683df - rustdoc[38c28cc48e8471ca]::core::run_global_ctxt
  27:     0x563cc3c9fa81 - rustdoc[38c28cc48e8471ca]::main_args::{closure#2}::{closure#0}
  28:     0x563cc3c9734a - rustc_interface[3af1732d5ed36fcb]::interface::run_compiler::<(), rustdoc[38c28cc48e8471ca]::main_args::{closure#2}>::{closure#1}
  29:     0x563cc3becd58 - std[9825f2e6b8e19478]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[3af1732d5ed36fcb]::util::run_in_thread_with_globals<rustc_interface[3af1732d5ed36fcb]::util::run_in_thread_pool_with_globals<rustc_interface[3af1732d5ed36fcb]::interface::run_compiler<(), rustdoc[38c28cc48e8471ca]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  30:     0x563cc3cd5d3d - <std[9825f2e6b8e19478]::thread::lifecycle::spawn_unchecked<rustc_interface[3af1732d5ed36fcb]::util::run_in_thread_with_globals<rustc_interface[3af1732d5ed36fcb]::util::run_in_thread_pool_with_globals<rustc_interface[3af1732d5ed36fcb]::interface::run_compiler<(), rustdoc[38c28cc48e8471ca]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[98665f3f32c5c4a4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7fb2d31467fa - <std[9825f2e6b8e19478]::sys::thread::unix::Thread>::new::thread_start
  32:     0x7fb2cca981b9 - <unknown>
  33:     0x7fb2ccb1d21c - <unknown>
  34:                0x0 - <unknown>

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-07-03T19_36_16-2520012.txt` to your bug report

note: rustc 1.98.0-nightly (c397dae80 2026-07-02) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [doc_link_resolutions] resolutions for documentation links for a module
end of query stack
error: aborting due to 1 previous error

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions