Enum rustc_errors::Level
source · pub enum Level {
Show 13 variants
Bug,
DelayedBug(DelayedBugKind),
Fatal,
Error,
ForceWarning(Option<LintExpectationId>),
Warning,
Note,
OnceNote,
Help,
OnceHelp,
FailureNote,
Allow,
Expect(LintExpectationId),
}
Variants§
Bug
For bugs in the compiler. Manifests as an ICE (internal compiler error) panic.
Its EmissionGuarantee
is BugAbort
.
DelayedBug(DelayedBugKind)
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.
Its EmissionGuarantee
is ErrorGuaranteed
for Normal
delayed bugs, and ()
for
GoodPath
delayed bugs.
Fatal
An error that causes an immediate abort. Used for things like configuration errors, internal overflows, some file operation errors.
Its EmissionGuarantee
is FatalAbort
, except in the non-aborting “almost fatal” case
that is occasionally used, where it is FatalError
.
Error
An error in the code being compiled, which prevents compilation from finishing. This is the most common case.
Its EmissionGuarantee
is ErrorGuaranteed
.
ForceWarning(Option<LintExpectationId>)
A force-warn
lint warning about the code being compiled. Does not prevent compilation
from finishing.
The LintExpectationId
is used 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.
Its EmissionGuarantee
is ()
.
Note
A message giving additional context. Rare, because notes are more commonly attached to other diagnostics such as errors.
Its EmissionGuarantee
is ()
.
OnceNote
A note that is only emitted once. Rare, mostly used in circumstances relating to lints.
Its EmissionGuarantee
is ()
.
Help
A message suggesting how to fix something. Rare, because help messages are more commonly attached to other diagnostics such as errors.
Its EmissionGuarantee
is ()
.
OnceHelp
A help that is only emitted once. Rare.
Its EmissionGuarantee
is ()
.
FailureNote
Similar to Note
, but used in cases where compilation has failed. Rare.
Its EmissionGuarantee
is ()
.
Allow
Only used for lints.
Its EmissionGuarantee
is ()
.
Expect(LintExpectationId)
Only used for lints.
Its EmissionGuarantee
is ()
.
Implementations§
Trait Implementations§
source§impl IntoDiagnosticArg for Level
impl IntoDiagnosticArg for Level
fn into_diagnostic_arg(self) -> DiagnosticArgValue
source§impl PartialEq for Level
impl PartialEq for Level
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
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
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: 24 bytes
Size for each variant:
Bug
: 0 bytesDelayedBug
: 1 byteFatal
: 0 bytesError
: 0 bytesForceWarning
: 23 bytesWarning
: 0 bytesNote
: 0 bytesOnceNote
: 0 bytesHelp
: 0 bytesOnceHelp
: 0 bytesFailureNote
: 0 bytesAllow
: 0 bytesExpect
: 23 bytes