pub struct LintLevelsBuilder<'s> {
    sess: &'s Session,
    lint_expectations: Vec<(LintExpectationId, LintExpectation)>,
    expectation_id_map: FxHashMap<LintExpectationId, LintExpectationId>,
    sets: LintLevelSets,
    id_to_set: FxHashMap<HirId, LintStackIndex>,
    cur: LintStackIndex,
    warn_about_weird_lints: bool,
    store: &'s LintStore,
    registered_tools: &'s RegisteredTools,
}

Fields

sess: &'s Sessionlint_expectations: Vec<(LintExpectationId, LintExpectation)>expectation_id_map: FxHashMap<LintExpectationId, LintExpectationId>

Each expectation has a stable and an unstable identifier. This map is used to map from unstable to stable LintExpectationIds.

sets: LintLevelSetsid_to_set: FxHashMap<HirId, LintStackIndex>cur: LintStackIndexwarn_about_weird_lints: boolstore: &'s LintStoreregistered_tools: &'s RegisteredTools

Implementations

Attempts to insert the id to level_src map entry. If unsuccessful (e.g. if a forbid was already inserted on the same scope), then emits a diagnostic with no change to specs.

Pushes a list of AST lint attributes onto this context.

This function will return a BuilderPush object which should be passed to pop when this scope for the attributes provided is exited.

This function will perform a number of tasks:

  • It’ll validate all lint-related attributes in attrs
  • It’ll mark all lint-related attributes as used
  • Lint levels will be updated based on the attributes provided
  • Lint attributes are validated, e.g., a #[forbid] can’t be switched to #[allow]

Don’t forget to call pop!

Checks if the lint is gated on a feature that is not enabled.

Returns true if the lint’s feature is enabled.

Called after push when the scope of a set of attributes are exited.

Find the lint level for a lint.

Used to emit a lint-related diagnostic based on the current state of this lint context.

Registers the ID provided with the current set of lints stored in this context.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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