Skip to content

Commit 5318545

Browse files
committed
document that the panic in collect_intra_doc_links is load-bearing
1 parent 3307274 commit 5318545

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+4
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
398398
.doc_link_resolutions(module_id)
399399
.get(&(Symbol::intern(path_str), ns))
400400
.copied()
401+
// NOTE: do not remove this panic! Missing links should be recorded as `Res::Err`; if
402+
// `doc_link_resolutions` is missing a `path_str`, that means that there are valid links
403+
// that are being missed. To fix the ICE, change
404+
// `rustc_resolve::rustdoc::attrs_to_preprocessed_links` to cache the link.
401405
.unwrap_or_else(|| panic!("no resolution for {:?} {:?} {:?}", path_str, ns, module_id))
402406
.and_then(|res| res.try_into().ok())
403407
.or_else(|| resolve_primitive(path_str, ns));

0 commit comments

Comments
 (0)