pub enum Subdiagnostic {
Note {
level: SubdiagnosticLevel,
message: Message,
},
TypeMismatch {
got: String,
got_outer: Option<String>,
expected: String,
expected_outer: Option<String>,
},
SpannedNote {
level: SubdiagnosticLevel,
labels: Labels,
},
TemplateTraceback {
span: FullSpan,
message: Message,
},
Suggestion {
parts: Vec<(FullSpan, String)>,
message: Message,
},
}
Expand description
An extra diagnostic that can further the main diagnostic in some way.
Variants§
Note
A simple note without a span.
TypeMismatch
SpannedNote
A longer note with additional spans and labels.
TemplateTraceback
Suggestion
A change suggestion, made up of one or more suggestion parts.
Fields
§
parts: Vec<(FullSpan, String)>
The individual replacements that make up this suggestion.
Additions, removals and replacements are encoded using the span and the suggested replacement according to the following table:
+-----------+-------------+----------------+
| Span | Replacement | Interpretation |
+-----------+-------------+----------------+
| Non-empty | Non-empty | Replacement |
| Non-empty | Empty | Removal |
| Empty | Non-empty | Addition |
| Empty | Empty | Invalid |
+-----------+-------------+----------------+
Implementations§
Trait Implementations§
Source§impl Clone for Subdiagnostic
impl Clone for Subdiagnostic
Source§fn clone(&self) -> Subdiagnostic
fn clone(&self) -> Subdiagnostic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Subdiagnostic
impl Debug for Subdiagnostic
Source§impl PartialEq for Subdiagnostic
impl PartialEq for Subdiagnostic
impl StructuralPartialEq for Subdiagnostic
Auto Trait Implementations§
impl Freeze for Subdiagnostic
impl RefUnwindSafe for Subdiagnostic
impl Send for Subdiagnostic
impl Sync for Subdiagnostic
impl Unpin for Subdiagnostic
impl UnwindSafe for Subdiagnostic
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more