Enum rustc_errors::Level
source · pub enum Level {
Show 13 variants
Bug,
Fatal,
Error,
DelayedBug,
ForceWarning(Option<LintExpectationId>),
Warning,
Note,
OnceNote,
Help,
OnceHelp,
FailureNote,
Allow,
Expect(LintExpectationId),
}
Expand description
Level is_error EmissionGuarantee Top-level Sub Used in lints?
Bug yes BugAbort yes - - Fatal yes FatalAbort/FatalError(*) 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
(*) FatalAbort
normally, FatalError
in 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(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.
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(LintExpectationId)
Only used for lints.
Implementations§
Trait Implementations§
source§impl IntoDiagArg for Level
impl IntoDiagArg for Level
fn into_diag_arg(self) -> DiagArgValue
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 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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Filterable for T
impl<T> Filterable for T
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>
§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<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for 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 bytesFatal
: 0 bytesError
: 0 bytesDelayedBug
: 0 bytesForceWarning
: 20 bytesWarning
: 0 bytesNote
: 0 bytesOnceNote
: 0 bytesHelp
: 0 bytesOnceHelp
: 0 bytesFailureNote
: 0 bytesAllow
: 0 bytesExpect
: 20 bytes