pub struct Diagnostic {
    pub message: String,
    pub code: Option<DiagnosticCode>,
    pub spans: Vec<DiagnosticSpan>,
    pub children: Vec<Diagnostic>,
    pub rendered: Option<String>,
    /* private fields */
}

Fields

message: String

The primary error message.

code: Option<DiagnosticCode>spans: Vec<DiagnosticSpan>children: Vec<Diagnostic>

Associated diagnostic messages.

rendered: Option<String>

The message as rustc would render it. Currently this is only Some for “suggestions”, but eventually it will include all snippets.

Trait Implementations

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. 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.