Skip to content

Commit e721f5e

Browse files
don't process external_traits when collecting intra-doc links
1 parent 1999a22 commit e721f5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+10
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ impl<'a, 'tcx, 'rcx> LinkCollector<'a, 'tcx, 'rcx> {
213213
_ => Err(())
214214
}
215215
} else {
216+
debug!("attempting to resolve item without parent module: {}", path_str);
216217
Err(())
217218
}
218219
}
@@ -434,6 +435,15 @@ impl<'a, 'tcx, 'rcx> DocFolder for LinkCollector<'a, 'tcx, 'rcx> {
434435
self.fold_item_recur(item)
435436
}
436437
}
438+
439+
// FIXME: if we can resolve intra-doc links from other crates, we can use the stock
440+
// `fold_crate`, but until then we should avoid scanning `krate.external_traits` since those
441+
// will never resolve properly
442+
fn fold_crate(&mut self, mut c: Crate) -> Crate {
443+
c.module = c.module.take().and_then(|module| self.fold_item(module));
444+
445+
c
446+
}
437447
}
438448

439449
/// Resolves a string as a macro.

0 commit comments

Comments
 (0)