Skip to content

rustdoc ICE: "tried to calculate a disambiguator for a def without a namespace?" #85615

Closed
@SergioBenitez

Description

@SergioBenitez

Unfortunately I don't have an easy-to-repro case. This happened while working on Rocket's docs. I renamed a method which made a previously valid link invalid and I got this ICE. Fixing the doc link fixes the error. Backtrace from rustc 1.54.0-nightly (5dc8789 2021-05-21) follows:

warning: unresolved link to `Context::value`
  --> core/lib/src/form/context.rs:63:10
   |
63 | /// via [`Context::value()`] or [`Context::values()`]. Data fields do not have
   |          ^^^^^^^^^^^^^^^^^^ the struct `Context` has no function named `value`
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

thread 'rustc' panicked at 'tried to calculate a disambiguator for a def without a namespace?', src/librustdoc/passes/collect_intra_doc_links.rs:1607:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5dc8789e300930751a78996da0fa906be5a344a2/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/5dc8789e300930751a78996da0fa906be5a344a2/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/5dc8789e300930751a78996da0fa906be5a344a2/library/core/src/option.rs:1241:5
   3: rustdoc::passes::collect_intra_doc_links::suggest_disambiguator
   4: core::ops::function::FnOnce::call_once{{vtable.shim}}
   5: rustc_middle::lint::struct_lint_level::struct_lint_level_impl
   6: rustdoc::passes::collect_intra_doc_links::LinkCollector::resolve_link::{{closure}}
   7: rustdoc::passes::collect_intra_doc_links::LinkCollector::resolve_link::{{closure}}
   8: rustdoc::passes::collect_intra_doc_links::LinkCollector::resolve_link
   9: <rustdoc::passes::collect_intra_doc_links::LinkCollector as rustdoc::fold::DocFolder>::fold_item
  10: alloc::vec::source_iter_marker::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  11: rustdoc::fold::DocFolder::fold_inner_recur
  12: rustdoc::fold::DocFolder::fold_item_recur
  13: <rustdoc::passes::collect_intra_doc_links::LinkCollector as rustdoc::fold::DocFolder>::fold_item
  14: alloc::vec::source_iter_marker::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  15: rustdoc::fold::DocFolder::fold_inner_recur
  16: rustdoc::fold::DocFolder::fold_item_recur
  17: <rustdoc::passes::collect_intra_doc_links::LinkCollector as rustdoc::fold::DocFolder>::fold_item
  18: alloc::vec::source_iter_marker::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  19: rustdoc::fold::DocFolder::fold_inner_recur
  20: rustdoc::fold::DocFolder::fold_item_recur
  21: <rustdoc::passes::collect_intra_doc_links::LinkCollector as rustdoc::fold::DocFolder>::fold_item
  22: rustdoc::passes::collect_intra_doc_links::collect_intra_doc_links
  23: rustdoc::core::run_global_ctxt
  24: rustc_interface::passes::QueryContext::enter
  25: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  26: rustc_span::with_source_map
  27: rustc_interface::interface::create_compiler_and_run
  28: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions