Skip to main content Module rustdoc Copy item path Source use std::mem ; π use std::ops::Range ; π use itertools::Itertools ; π use pulldown_cmark::BrokenLink ; π use pulldown_cmark::BrokenLinkCallback ; π use pulldown_cmark::CowStr ; π use pulldown_cmark::Event ; π use pulldown_cmark::LinkType ; π use pulldown_cmark::Options ; π use pulldown_cmark::Parser ; π use pulldown_cmark::Tag ; π use rustc_ast as ast; π use rustc_ast::attr::AttributeExt ; π use rustc_ast::token::DocFragmentKind ; π use rustc_ast::util::comments::beautify_doc_string ; π use rustc_ast::AttrKind ; π use rustc_ast::AttrStyle ; π use rustc_ast::join_path_syms ; π use rustc_attr_ir::Attribute ; π use rustc_attr_ir::AttributeKind ; π use rustc_attr_ir::DocAttribute ; π use rustc_data_structures::fx::FxIndexMap ; π use rustc_data_structures::unord::UnordSet ; π use rustc_middle::ty::TyCtxt ; π use rustc_span::def_id::DefId ; π use rustc_span::source_map::SourceMap ; π use rustc_span::DUMMY_SP ; π use rustc_span::InnerSpan ; π use rustc_span::Span ; π use rustc_span::Symbol ; π use rustc_span::sym ; π use thin_vec::ThinVec ; π use tracing::debug ; π use tracing::trace ; π pub use pulldown_cmark ;DocFragment A portion of documentation, extracted from a #[doc] attribute. DocStrings Represents a doc comment, split in two parts, outer and inner attributes. Itβs needed for
the intra-doc link resolution context. MalformedGenerics add_doc_fragment The goal of this function is to apply the DocFragment transformation that is required when
transforming into the final Markdown, which is applying the computed indent to each line in
each doc fragment (a DocFragment can contain multiple lines in case of #[doc = ""]). attrs_to_doc_fragments attrs_to_preprocessed_links π Simplified version of preprocessed_markdown_links from rustdoc.
Must return at least the same links as it, but may add some more links on top of that. collect_link_data π Collects additional data of link. has_primitive_or_keyword_or_attribute_docs_ast Has #[rustc_doc_primitive] or #[doc(keyword)] or #[doc(attribute)]. has_primitive_or_keyword_or_attribute_docs_hir Has #[rustc_doc_primitive] or #[doc(keyword)] or #[doc(attribute)]. main_body_opts Options for rendering Markdown in the main body of documentation. may_be_doc_link Keep inline and reference links [],
but skip autolinks <> which we never consider to be intra-doc links. parse_links π Similar version of markdown_links from rustdoc.
This will collect destination links and display text if exists. prepare_to_doc_link_resolution Return the doc-comments on this item, grouped by the module they came from.
The module can be different if this is a re-export with added documentation. preprocess_link π Simplified version of the corresponding function in rustdoc. source_span_for_markdown_range Attempts to match a range of bytes from parsed markdown to a Span in the source code. source_span_for_markdown_range_inner span_of_fragments Returns a span encompassing all the document fragments. strip_generics_from_path strip_generics_from_path_segment π unindent_doc_fragments Removes excess indentation on comments in order for the Markdown
to be parsed correctly. This is necessary because the convention for
writing documentation is to provide a space between the /// or //! marker
and the doc text, but Markdown is whitespace-sensitive. For example,
a block of text with four-space indentation is parsed as a code block,
so if we didnβt unindent comments, these list items