Closed
Description
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
Area: Messages for errors, warnings, and lintsArea: Intra-doc links, the ability to link to items in docs by nameCategory: This is a bug.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the rustdoc team, which will review and decide on the PR/issue.
Activity
jyn514 commentedon May 24, 2021
If someone can compile a build of rustdoc that comments out this line:
rust/src/librustdoc/passes/collect_intra_doc_links.rs
Line 1173 in f64503e
you should get a much better error message that says exactly what went wrong (it will start with "incompatible link kind"), and that should give an idea of where the bug is.
jyn514 commentedon May 24, 2021
@SergioBenitez can you link to the exact commit of Rocket that caused the ICE?
SergioBenitez commentedon May 24, 2021
This is the current
master
tip, rwf2/Rocket@ab13d73. You may be able to replicate this by referencingContext::value()
in the struct's docs incore/lib/src/form/context.rs
and then changing the method's name to something else. If this fails, I will try to create a reproducible case.fee1-dead commentedon Jul 12, 2021
MCVE:
@rustbot label -E-needs-mcve
fee1-dead commentedon Jul 12, 2021
@rustbot claim
rustbot commentedon Jul 12, 2021
Error: Parsing relabel command in comment failed: ...'needs-MCVE' | error: a label delta at >| '):
4 remaining items