Skip to main content

Module collect_intra_doc_links

Module collect_intra_doc_links 

Source
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_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::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::PrimitiveType; πŸ”’
use crate::clean::reexport_chain; πŸ”’
use crate::core::DocContext; πŸ”’
use crate::html::markdown::MarkdownLinkRange; πŸ”’
use crate::visit::DocVisitor; πŸ”’
use rustc_hir::def::Namespace::*; πŸ”’

StructsΒ§

AmbiguousLinks πŸ”’
DiagnosticInfo πŸ”’
LinkCollection πŸ”’
LinkCollector πŸ”’
OwnedDiagnosticInfo πŸ”’
PreprocessedMarkdownLink πŸ”’
PreprocessingInfo πŸ”’
ResolutionInfo πŸ”’
UnresolvedPath πŸ”’
The link failed to resolve. resolution_failure should look to see if there’s a more helpful error that can be given.

EnumsΒ§

Disambiguator πŸ”’
Disambiguators for a link.
PreprocessingError πŸ”’
Res πŸ”’
ResolutionFailure πŸ”’
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 Res and 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_str due to it being unlikely that it is an intra-doc link.
should_ignore_link_with_disambiguators πŸ”’
Returns true if we should ignore link due to it being unlikely that it is an intra-doc link. link should 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_id that corresponds to the trait associated item trait_assoc_id.
trait_impls_for πŸ”’
Given a type, return all trait impls in scope in module for 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Β§

ResolveRes πŸ”’