1
Fork 0

Store links in Cache instead of on items directly

Items are first built after rustdoc creates the TyCtxt. To allow
resolving the links before the TyCtxt is built, the links can't be
stored on `clean::Item` directly.
This commit is contained in:
Joshua Nelson 2021-04-03 22:15:24 -04:00
parent 16143d1067
commit 9e11902eff
4 changed files with 82 additions and 82 deletions

View file

@ -120,6 +120,11 @@ crate struct Cache {
// when gathering trait documentation on a type, hold impls here while
// folding and add them to the cache later on if we find the trait.
orphan_trait_impls: Vec<(DefId, FxHashSet<DefId>, Impl)>,
/// All intra-doc links resolved so far.
///
/// Links are indexed by the DefId of the item they document.
crate intra_doc_links: BTreeMap<DefId, Vec<clean::ItemLink>>,
}
/// This struct is used to wrap the `cache` and `tcx` in order to run `DocFolder`.