pub struct SemanticDiagnostic {
pub stable_location: StableLocation,
pub kind: SemanticDiagnosticKind,
pub after: bool,
}
Fields§
§stable_location: StableLocation
§kind: SemanticDiagnosticKind
§after: bool
true if the diagnostic should be reported after the given location. Normally false, in which case the diagnostic points to the given location (as-is).
Implementations§
Source§impl SemanticDiagnostic
impl SemanticDiagnostic
Sourcepub fn new(
stable_location: StableLocation,
kind: SemanticDiagnosticKind,
) -> Self
pub fn new( stable_location: StableLocation, kind: SemanticDiagnosticKind, ) -> Self
Create a diagnostic in the given location.
Sourcepub fn new_after(
stable_location: StableLocation,
kind: SemanticDiagnosticKind,
) -> Self
pub fn new_after( stable_location: StableLocation, kind: SemanticDiagnosticKind, ) -> Self
Create a diagnostic in the location after the given location (with width 0).
Trait Implementations§
Source§impl Clone for SemanticDiagnostic
impl Clone for SemanticDiagnostic
Source§fn clone(&self) -> SemanticDiagnostic
fn clone(&self) -> SemanticDiagnostic
Returns a copy 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 SemanticDiagnostic
impl Debug for SemanticDiagnostic
Source§impl DiagnosticEntry for SemanticDiagnostic
impl DiagnosticEntry for SemanticDiagnostic
type DbType = dyn SemanticGroup
fn format(&self, db: &Self::DbType) -> String
fn location(&self, db: &Self::DbType) -> DiagnosticLocation
fn severity(&self) -> Severity
fn error_code(&self) -> Option<ErrorCode>
Source§fn is_same_kind(&self, other: &Self) -> bool
fn is_same_kind(&self, other: &Self) -> bool
Returns true if the two should be regarded as the same kind when filtering duplicate
diagnostics.
fn notes(&self, _db: &Self::DbType) -> &[DiagnosticNote]
Source§impl Hash for SemanticDiagnostic
impl Hash for SemanticDiagnostic
Source§impl PartialEq for SemanticDiagnostic
impl PartialEq for SemanticDiagnostic
impl Eq for SemanticDiagnostic
impl StructuralPartialEq for SemanticDiagnostic
Auto Trait Implementations§
impl Freeze for SemanticDiagnostic
impl RefUnwindSafe for SemanticDiagnostic
impl Send for SemanticDiagnostic
impl Sync for SemanticDiagnostic
impl Unpin for SemanticDiagnostic
impl UnwindSafe for SemanticDiagnostic
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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