Level in rustc_errors - Rust (original) (raw)

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

§

For bugs in the compiler. Manifests as an ICE (internal compiler error) panic.

§

An error that causes an immediate abort. Used for things like configuration errors, internal overflows, some file operation errors.

§

An error in the code being compiled, which prevents compilation from finishing. This is the most common case.

§

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.

§

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.

§

A warning about the code being compiled. Does not prevent compilation from finishing. Will be skipped if can_emit_warnings is false.

§

A message giving additional context.

§

A note that is only emitted once.

§

A message suggesting how to fix something.

§

A help that is only emitted once.

§

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.

§

Only used for lints.

§

Only used for lints. Requires a LintExpectationId for silencing the lints.

§

§

§

§

§

§

§

§

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: