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/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 |
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
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<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> 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: 20 bytes
Size for each variant:
Bug
: 0 bytesFatal
: 0 bytesError
: 0 bytesDelayedBug
: 0 bytesForceWarning
: 16 bytesWarning
: 0 bytesNote
: 0 bytesOnceNote
: 0 bytesHelp
: 0 bytesOnceHelp
: 0 bytesFailureNote
: 0 bytesAllow
: 0 bytesExpect
: 16 bytes