Struct rustc::lint::levels::LintLevelsBuilder [−][src]
pub struct LintLevelsBuilder<'a> {
sess: &'a Session,
sets: LintLevelSets,
id_to_set: FxHashMap<HirId, u32>,
cur: u32,
warn_about_weird_lints: bool,
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Fields
sess: &'a Session
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
sets: LintLevelSets
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
id_to_set: FxHashMap<HirId, u32>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
cur: u32
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
warn_about_weird_lints: bool
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<'a> LintLevelsBuilder<'a>[src]
impl<'a> LintLevelsBuilder<'a>pub fn new(sess: &'a Session, sets: LintLevelSets) -> LintLevelsBuilder<'a>[src]
pub fn new(sess: &'a Session, sets: LintLevelSets) -> LintLevelsBuilder<'a>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn push(&mut self, attrs: &[Attribute]) -> BuilderPush[src]
pub fn push(&mut self, attrs: &[Attribute]) -> BuilderPush🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Pushes a list of AST lint attributes onto this context.
This function will return a BuilderPush object which should be 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 attriutes 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!
pub fn pop(&mut self, push: BuilderPush)[src]
pub fn pop(&mut self, push: BuilderPush)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Called after push when the scope of a set of attributes are exited.
pub fn struct_lint(
&self,
lint: &'static Lint,
span: Option<MultiSpan>,
msg: &str
) -> DiagnosticBuilder<'a>[src]
pub fn struct_lint(
&self,
lint: &'static Lint,
span: Option<MultiSpan>,
msg: &str
) -> DiagnosticBuilder<'a>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Used to emit a lint-related diagnostic based on the current state of this lint context.
pub fn register_id(&mut self, id: HirId)[src]
pub fn register_id(&mut self, id: HirId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Registers the ID provided with the current set of lints stored in this context.
pub fn build(self) -> LintLevelSets[src]
pub fn build(self) -> LintLevelSets🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn build_map(self) -> LintLevelMap[src]
pub fn build_map(self) -> LintLevelMap🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Auto Trait Implementations
impl<'a> !Send for LintLevelsBuilder<'a>
impl<'a> !Send for LintLevelsBuilder<'a>impl<'a> !Sync for LintLevelsBuilder<'a>
impl<'a> !Sync for LintLevelsBuilder<'a>