Enum marker_api::common::Level
source · #[non_exhaustive]#[repr(C)]pub enum Level {
Allow = 0,
Warn = 1,
Deny = 2,
Forbid = 3,
}
Expand description
Setting for how to handle a lint.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Allow = 0
The lint is allowed. A created diagnostic will not be emitted to the user by default. This level can be overridden. It’s useful for rather strict lints.
Warn = 1
The warn
level will produce a warning if the lint was violated, however the
compiler will continue with its execution.
This level might also be used in instances were the diagnostic is not emitted to the user but used internally. This can for instance happen for lint expectations (RFC 2383).
Deny = 2
The deny
level will produce an error and stop further execution after the lint
pass is complete.
Forbid = 3
The forbid
level will produce an error and cannot be overridden by the user.
Choosing this diagnostic level should require heavy consideration, because should a lint
with this level produce a false-positive, the user won’t have an option to allow
the lint
for this particular case, and will be forced to either:
- Write wrong code just to satisfy the lint
- Remove the whole lint crate
To produce an error, but make the lint possible to override see Deny
.
Trait Implementations§
source§impl Ord for Level
impl Ord for Level
source§impl PartialEq for Level
impl PartialEq for Level
source§impl PartialOrd for Level
impl PartialOrd for Level
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more