Expand description
Resolves intra-doc links (RFC 1946).
Re-exportsΒ§
use std::borrow::Cow;πuse std::fmt::Display;πuse std::mem;πuse std::ops::Range;πuse rustc_ast::util::comments::may_have_doc_links;πuse rustc_attr_ir::Attribute;πuse rustc_attr_ir::AttributeKind;πuse rustc_attr_ir::find_attr;πuse rustc_data_structures::fx::FxHashMap;πuse rustc_data_structures::fx::FxHashSet;πuse rustc_data_structures::fx::FxIndexMap;πuse rustc_data_structures::fx::FxIndexSet;πuse rustc_data_structures::intern::Interned;πuse rustc_errors::Applicability;πuse rustc_errors::Diag;πuse rustc_errors::DiagMessage;πuse rustc_hir::def::DefKind;πuse rustc_hir::def::MacroKinds;πuse rustc_hir::def::Namespace;πuse rustc_hir::def::PerNS;πuse rustc_hir::def_id::CRATE_DEF_ID;πuse rustc_hir::def_id::DefId;πuse rustc_hir::def_id::LOCAL_CRATE;πuse rustc_hir::Mutability;πuse rustc_hir::Safety;πuse rustc_lint::Lint;πuse rustc_middle::ty;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_resolve::rustdoc::pulldown_cmark::LinkType;πuse rustc_resolve::rustdoc::DocStrings;πuse rustc_resolve::rustdoc::MalformedGenerics;πuse rustc_resolve::rustdoc::has_primitive_or_keyword_or_attribute_docs_hir;πuse rustc_resolve::rustdoc::prepare_to_doc_link_resolution;πuse rustc_resolve::rustdoc::source_span_for_markdown_range;πuse rustc_resolve::rustdoc::strip_generics_from_path;πuse rustc_span::def_id::ModId;πuse rustc_span::edit_distance::find_best_match_for_name;πuse rustc_span::symbol::Ident;πuse rustc_span::symbol::Symbol;πuse rustc_span::symbol::sym;πuse rustc_span::BytePos;πuse rustc_span::bug;πuse rustc_span::span_bug;πuse rustc_structures::CrateType;πuse smallvec::SmallVec;πuse smallvec::smallvec;πuse tracing::debug;πuse tracing::info;πuse tracing::instrument;πuse tracing::instrument;πuse tracing::trace;πuse crate::clean::utils::find_nearest_parent_module;πuse crate::clean;πuse crate::clean::Crate;πuse crate::clean::Item;πuse crate::clean::ItemId;πuse crate::clean::ItemLink;πuse crate::clean::PrimitiveType;πuse crate::clean::reexport_chain;πuse crate::core::DocContext;πuse crate::html::markdown::MarkdownLink;πuse crate::html::markdown::MarkdownLinkRange;πuse crate::html::markdown::markdown_links;πuse crate::lint::BROKEN_INTRA_DOC_LINKS;πuse crate::lint::PRIVATE_INTRA_DOC_LINKS;πuse crate::visit::DocVisitor;πuse rustc_hir::def::Namespace::*;π
StructsΒ§
- Ambiguous
Links π - Diagnostic
Info π - Link
Collection π - Link
Collector π - Owned
Diagnostic πInfo - Preprocessed
Markdown πLink - Preprocessing
Info π - Resolution
Info π - Unresolved
Path π - The link failed to resolve.
resolution_failureshould look to see if thereβs a more helpful error that can be given.
EnumsΒ§
- Disambiguator π
- Disambiguators for a link.
- Preprocessing
Error π - Res π
- Resolution
Failure π - Suggestion π
- A suggestion to show in a diagnostic.
- UrlFragment π
FunctionsΒ§
- ambiguity_
error π - Report an ambiguity error, where there were multiple possible resolutions.
- anchor_
failure π - Report an anchor failure.
- collect_
intra_ πdoc_ links - disambiguator_
error π - Report an error in the link disambiguator.
- filter_
assoc_ πitems_ by_ name_ and_ namespace - full_
res π - is_
assoc_ πitem_ on_ alias_ page - is_
derive_ πtrait_ collision - Check for resolve collisions between a trait and its derive.
- preprocess_
link π - Returns:
- preprocessed_
markdown_ πlinks - primitive_
type_ πto_ ty - Convert a PrimitiveType to a Ty, where possible.
- privacy_
error π - Report a link from a public item to a private one.
- range_
between_ πbackticks - Get the section of a link between the backticks, or the whole link if there arenβt any backticks.
- report_
anchor_ πconflict - report_
diagnostic π - Reports a diagnostic for an intra-doc link.
- report_
malformed_ πgenerics - report_
multiple_ πanchors - resolution_
failure π - Reports a link that failed to resolve.
- resolve_
ambiguous_ πlinks - resolve_
assoc_ πon_ adt - resolve_
assoc_ πon_ primitive - resolve_
assoc_ πon_ simple_ type - βSimpleβ i.e. an ADT, foreign type, etc. β not a type alias, primitive type, or other trickier type.
- resolve_
associated_ πitem - Resolve an associated item, returning its containing pageβs
Resand the fragment targeting the associated item on its page. - resolve_
associated_ πtrait_ item - Look to see if a resolved item has an associated item named
item_name. - resolve_
primitive π - Resolve a primitive type or value.
- resolve_
primitive_ πinherent_ assoc_ item - Given a primitive type, try to resolve an associated item.
- resolve_
self_ πty - resolve_
structfield π - should_
ignore_ πlink - Returns true if we should ignore
path_strdue to it being unlikely that it is an intra-doc link. - should_
ignore_ πlink_ with_ disambiguators - Returns true if we should ignore
linkdue to it being unlikely that it is an intra-doc link.linkshould still have disambiguators if there were any. - suggest_
disambiguator π - In case of an ambiguity or mismatched disambiguator, suggest the correct disambiguator.
- suggest_
path_ πname_ typo - trait_
assoc_ πto_ impl_ assoc_ item - Find the associated item in the impl
impl_idthat corresponds to the trait associated itemtrait_assoc_id. - trait_
impls_ πfor - Given a type, return all trait impls in scope in
modulefor that type. Returns a set of pairs of(impl_id, trait_id). - ty_
to_ πres - Convert a Ty to a Res, where possible.
Type AliasesΒ§
- Resolve
Res π