pub(super) struct ConstEvalErr<'tcx> {
    pub span: Span,
    pub error: InterpError<'tcx>,
    pub stacktrace: Vec<FrameInfo<'tcx>>,
}
Expand description

When const-evaluation errors, this type is constructed with the resulting information, and then used to emit the error as a lint or hard error.

Fields§

§span: Span§error: InterpError<'tcx>§stacktrace: Vec<FrameInfo<'tcx>>

Implementations§

Turn an interpreter error into something to report to the user. As a side-effect, if RUSTC_CTFE_BACKTRACE is set, this prints the backtrace. Should be called only if the error is actually going to be reported!

Create a diagnostic for this const eval error.

Sets the message passed in via message and adds span labels with detailed error information before handing control back to decorate to do any final annotations, after which the diagnostic is emitted.

If lint_root.is_some() report it as a lint, else report it as a hard error. (Except that for some errors, we ignore all that – see must_error below.)

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 96 bytes