ErrorGuaranteed in rustc_errors - Rust (original) (raw)
Struct ErrorGuaranteed
pub struct ErrorGuaranteed(pub(crate) ());
Expand description
Useful type to use with Result<>
indicate that an error has already been reported to the user, so no need to continue checking.
The ()
field is necessary: it is non-pub
, which means values of this type cannot be constructed outside of this crate.
👎Deprecated: should only be used in DiagCtxtInner::emit_diagnostic
Don’t use this outside of DiagCtxtInner::emit_diagnostic
!
Implementation of Diag::emit
, fully controlled by each impl
ofEmissionGuarantee
, to make it impossible to create a value ofSelf::EmitResult
without actually performing the emission.
This exists so that bugs and fatal errors can both result in !
(an abort) when emitted, but have different aborting behaviour.
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self
and other
values if one exists. Read more
Tests less than (for self
and other
) and is used by the <
operator. Read more
Tests less than or equal to (for self
and other
) and is used by the<=
operator. Read more
Tests greater than (for self
and other
) and is used by the >
operator. Read more
Tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
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: 0 bytes