Function rustdoc::html::render::span_map::collect_spans_and_sources [−][src]
pub(crate) fn collect_spans_and_sources(
tcx: TyCtxt<'_>,
krate: Crate,
src_root: &Path,
include_sources: bool,
generate_link_to_definition: bool
) -> (Crate, FxHashMap<PathBuf, String>, FxHashMap<Span, LinkFromSrc>)Expand description
This function will do at most two things:
- Generate a
spancorrespondance map which links an itemspanto its definitionspan. - Collect the source code files.
It returns the krate, the source code files and the span correspondance map.
Note about the span correspondance map: the keys are actually (lo, hi) of spans. We don’t
need the span context later on, only their position, so instead of keep a whole Span, we
only keep the lo and hi.