rustdoc::clean - Rust (original) (raw)
Expand description
This module defines the primary IR1 used in rustdoc together with the procedures that transform rustc data types into it.
This IR β commonly referred to as the cleaned AST β is modeled after the AST.
There are two kinds of transformation β cleaning β procedures:
- Cleans HIR types. Used for user-written code and inlined local re-exports both found in the local crate.
- Cleans rustc_middle::ty types. Used for inlined cross-crate re-exports and anything output by the trait solver (e.g., when synthesizing blanket and auto-trait impls). They usually have
ty
ormiddle
in their name.
Their name is prefixed by clean_
.
Both the HIR and the rustc_middle::ty
IR are quite removed from the source code. The cleaned AST on the other hand is closer to it which simplifies the rendering process. Furthermore, operating on a single IR instead of two avoids duplicating efforts down the line.
This IR is consumed by both the HTML and the JSON backend.
auto_trait π
blanket_impl π
cfg π
The representation of a #[doc(cfg(...))]
attribute.
inline π
Support for inlining external documentation into the current AST.
simplify π
Simplification of where-clauses and parameter bounds into a prettier and more canonical form.
types π
utils π
ContainerTy π
ParamDefaults π
Whether to clean generic parameter defaults or not.
ParamsSrc π
add_without_unwanted_attributes π
When inlining items, we merge their attributes (and all the reexports attributes too) with the final reexport. For example:
can_elide_trait_object_lifetime_bound π
clean_assoc_item_constraint π
clean_bare_fn_ty π
clean_bound_vars π
clean_const π
clean_doc_module π
clean_extern_crate π
clean_field π
clean_fn_decl_legacy_const_generics π
This is needed to make it more βreadableβ when documenting functions usingrustc_legacy_const_generics
. More information inhttps://github.com/rust-lang/rust/issues/83167.
clean_fn_decl_with_params π
clean_function π
clean_generic_args π
clean_generic_bound π
clean_generic_param π
clean_generics π
clean_hir_term π
clean_impl π
clean_impl_item π
clean_lifetime π
clean_maybe_renamed_foreign_item π
clean_middle_const π
clean_middle_field π
clean_middle_opaque_bounds π
clean_middle_region π
clean_middle_term π
clean_middle_ty π
clean_params π
clean_path π
clean_path_segment π
clean_poly_fn_sig π
clean_poly_trait_predicate π
clean_poly_trait_ref π
clean_poly_trait_ref_with_constraints π
clean_precise_capturing_arg π
clean_predicate π
clean_proc_macro π
clean_projection π
clean_projection_predicate π
clean_qpath π
clean_region_outlives_predicate π
clean_trait_item π
clean_trait_object_lifetime_bound π
clean_trait_ref π
clean_trait_ref_with_constraints π
clean_ty π
clean_ty_alias_inner_type π
clean_ty_generics π
clean_type_outlives_predicate π
clean_use_statement π
clean_use_statement_inner π
clean_variant π
clean_variant_data π
clean_variant_def π
clean_variant_def_with_args π
filter_doc_attr π
Remove attributes from normal
that should not be inherited by use
re-export. Before calling this function, make sure normal
is a #[doc]
attribute.
first_non_private π
The goal of this function is to return the first Path
which is not private (ie not private or doc(hidden)
). If itβs not possible, itβll return the βend typeβ.
first_non_private_clean_path π
generate_item_with_correct_attrs π
get_all_import_attributes π
Collect attributes from the whole import chain.
is_elided_lifetime π
This can happen for async fn
, e.g. async fn f<'_>(&'_ self)
.
is_glob_import π
is_impl_trait π
Synthetic type-parameters are inserted after normal ones. In order for normal parameters to be able to refer to synthetic ones, scans them first.
maybe_expand_private_type_alias π
normalize π
Returns None
if the type could not be normalized
projection_to_path_segment π
reexport_chain π