pub enum Level {
Show 13 variants
    Bug,
    Fatal,
    Error,
    DelayedBug,
    ForceWarning,
    Warning,
    Note,
    OnceNote,
    Help,
    OnceHelp,
    FailureNote,
    Allow,
    Expect,
}Expand description
| Level | is_error | EmissionGuarantee | Top-level | Sub | Used in lints? | 
|---|---|---|---|---|---|
| Bug | yes | BugAbort | yes | - | - | 
| Fatal | yes | FatalAbort/FatalError1 | yes | - | - | 
| Error | yes | ErrorGuaranteed | yes | - | yes | 
| DelayedBug | yes | ErrorGuaranteed | yes | - | - | 
| ForceWarning | - | () | yes | - | lint-only | 
| Warning | - | () | yes | yes | yes | 
| Note | - | () | rare | yes | - | 
| OnceNote | - | () | - | yes | lint-only | 
| Help | - | () | rare | yes | - | 
| OnceHelp | - | () | - | yes | lint-only | 
| FailureNote | - | () | rare | - | - | 
| Allow | - | () | yes | - | lint-only | 
| Expect | - | () | yes | - | lint-only | 
- FatalAbortnormally,- FatalErrorin the non-aborting “almost fatal” case that is occasionally used. ↩
Variants§
Bug
For bugs in the compiler. Manifests as an ICE (internal compiler error) panic.
Fatal
An error that causes an immediate abort. Used for things like configuration errors, internal overflows, some file operation errors.
Error
An error in the code being compiled, which prevents compilation from finishing. This is the most common case.
DelayedBug
This is a strange one: lets you register an error without emitting it. If compilation ends without any other errors occurring, this will be emitted as a bug. Otherwise, it will be silently dropped. I.e. “expect other errors are emitted” semantics. Useful on code paths that should only be reached when compiling erroneous code.
ForceWarning
A force-warn lint warning about the code being compiled. Does not prevent compilation
from finishing.
Requires a LintExpectationId for expected lint diagnostics. In all other cases this
should be None.
Warning
A warning about the code being compiled. Does not prevent compilation from finishing.
Will be skipped if can_emit_warnings is false.
Note
A message giving additional context.
OnceNote
A note that is only emitted once.
Help
A message suggesting how to fix something.
OnceHelp
A help that is only emitted once.
FailureNote
Similar to Note, but used in cases where compilation has failed. When printed for human
consumption, it doesn’t have any kind of note: label.
Allow
Only used for lints.
Expect
Only used for lints. Requires a LintExpectationId for silencing the lints.
Implementations§
Trait Implementations§
Source§impl IntoDiagArg for Level
 
impl IntoDiagArg for Level
Source§fn into_diag_arg(self, _: &mut Option<PathBuf>) -> DiagArgValue
 
fn into_diag_arg(self, _: &mut Option<PathBuf>) -> DiagArgValue
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl DynSend for Level
impl DynSync for Level
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
 
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
 
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
 
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
 
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
    T: 'static,
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: 1 byte
Size for each variant:
- Bug: 0 bytes
- Fatal: 0 bytes
- Error: 0 bytes
- DelayedBug: 0 bytes
- ForceWarning: 0 bytes
- Warning: 0 bytes
- Note: 0 bytes
- OnceNote: 0 bytes
- Help: 0 bytes
- OnceHelp: 0 bytes
- FailureNote: 0 bytes
- Allow: 0 bytes
- Expect: 0 bytes