Struct clippy_utils::LateContext[−][src]

pub(crate) struct LateContext<'tcx> {
    pub tcx: TyCtxt<'tcx>,
    pub enclosing_body: Option<BodyId>,
    pub(crate) cached_typeck_results: Cell<Option<&'tcx TypeckResults<'tcx>>>,
    pub param_env: ParamEnv<'tcx>,
    pub access_levels: &'tcx AccessLevels<LocalDefId>,
    pub lint_store: &'tcx LintStore,
    pub last_node_with_lint_attrs: HirId,
    pub generics: Option<&'tcx Generics<'tcx>>,
    pub only_module: bool,
}
Expand description

Context for lint checking after type checking.

Fields

tcx: TyCtxt<'tcx>

Type context we’re checking in.

enclosing_body: Option<BodyId>

Current body, or None if outside a body.

cached_typeck_results: Cell<Option<&'tcx TypeckResults<'tcx>>>

Type-checking results for the current body. Access using the typeck_results and maybe_typeck_results methods, which handle querying the typeck results on demand.

param_env: ParamEnv<'tcx>

Parameter environment for the item we are in.

access_levels: &'tcx AccessLevels<LocalDefId>

Items accessible from the crate being checked.

lint_store: &'tcx LintStore

The store of registered lints and the lint levels.

last_node_with_lint_attrs: HirIdgenerics: Option<&'tcx Generics<'tcx>>

Generic type parameters in scope for the item we are in.

only_module: bool

We are only looking at one module

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Computes the layout of a type. Note that this implicitly executes in “reveal all” mode, and will normalize the input type. Read more

Computes the layout of a type, at span. Note that this implicitly executes in “reveal all” mode, and will normalize the input type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

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: 72 bytes