Struct rustc::lint::Lint [−][src]
pub struct Lint { pub name: &'static str, pub default_level: Level, pub desc: &'static str, pub edition_lint_opts: Option<(Edition, Level)>, }
🔬 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?
Specification of a single lint.
Fields
name: &'static str
🔬 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?
A string identifier for the lint.
This identifies the lint in attributes and in command-line arguments.
In those contexts it is always lowercase, but this field is compared
in a way which is case-insensitive for ASCII characters. This allows
declare_lint!()
invocations to follow the convention of upper-case
statics without repeating the name.
The name is written with underscores, e.g. "unused_imports". On the command line, underscores become dashes.
default_level: Level
🔬 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?
Default level for the lint.
desc: &'static str
🔬 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?
Description of the lint or the issue it detects.
e.g. "imports that are never used"
edition_lint_opts: Option<(Edition, Level)>
🔬 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?
Starting at the given edition, default to the given lint level. If this is None
, then use
default_level
.
Methods
impl Lint
[src]
impl Lint
pub fn name_lower(&self) -> String
[src]
pub fn name_lower(&self) -> String
🔬 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?
Get the lint's name, with ASCII letters converted to lowercase.
pub fn default_level(&self, session: &Session) -> Level
[src]
pub fn default_level(&self, session: &Session) -> Level
🔬 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?
Trait Implementations
impl Copy for Lint
[src]
impl Copy for Lint
impl Clone for Lint
[src]
impl Clone for Lint
fn clone(&self) -> Lint
[src]
fn clone(&self) -> Lint
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Lint
[src]
impl Debug for Lint
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<&'static Lint> for DiagnosticMessageId
[src]
impl From<&'static Lint> for DiagnosticMessageId