DocContext in rustdoc::core - Rust (original) (raw)

pub(crate) struct DocContext<'tcx> {Show 14 fields
    pub(crate) tcx: TyCtxt<'tcx>,
    pub(crate) param_env: ParamEnv<'tcx>,
    pub(crate) external_traits: FxIndexMap<DefId, Trait>,
    pub(crate) active_extern_traits: DefIdSet,
    pub(crate) args: DefIdMap<GenericArg>,
    pub(crate) current_type_aliases: DefIdMap<usize>,
    pub(crate) impl_trait_bounds: FxHashMap<ImplTraitParam, Vec<GenericBound>>,
    pub(crate) generated_synthetics: FxHashSet<(Ty<'tcx>, DefId)>,
    pub(crate) auto_traits: Vec<DefId>,
    pub(crate) render_options: RenderOptions,
    pub(crate) cache: Cache,
    pub(crate) inlined: FxHashSet<ItemId>,
    pub(crate) output_format: OutputFormat,
    pub(crate) show_coverage: bool,
}

Used for normalization.

Most of this logic is copied from rustc_lint::late.

Later on moved through clean::Crate into cache

Used while populating external_traits to ensure we don’t process the same trait twice at the same time.

The current set of parameter instantiations for expanding type aliases at the HIR level.

Maps from the DefId of a lifetime or type parameter to the generic argument it’s currently instantiated to in this context.

Table synthetic type parameter for impl Trait in argument position -> bounds

Auto-trait or blanket impls processed so far, as (self_ty, trait_def_id).

The options given to rustdoc that could be relevant to a pass.

This same cache is used throughout rustdoc, including in crate::html::render.

Used by clean::inline to tell if an item has already been inlined.

Used by calculate_doc_coverage.

Used by strip_private.

Source§

Source

Source

Source

Source

Call the closure with the given parameters set as the generic parameters for a type alias’ RHS.

Source

Like tcx.local_def_id_to_hir_id(), but skips calling it on fake DefIds. (This avoids a slice-index-out-of-bounds panic.)

Source

Returns true if the JSON output format is enabled for generating the crate content.

If another option like --show-coverage is enabled, it will return false.

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 1536 bytes