Struct rustc_lint::levels::LintLevelsBuilder[][src]

pub struct LintLevelsBuilder<'s> {
    sess: &'s Session,
    sets: LintLevelSets,
    id_to_set: FxHashMap<HirId, LintStackIndex>,
    cur: LintStackIndex,
    warn_about_weird_lints: bool,
    store: &'s LintStore,
    crate_attrs: &'s [Attribute],
}

Fields

sess: &'s Sessionsets: LintLevelSetsid_to_set: FxHashMap<HirId, LintStackIndex>cur: LintStackIndexwarn_about_weird_lints: boolstore: &'s LintStorecrate_attrs: &'s [Attribute]

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.

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

Performs the conversion.

Performs the conversion.

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