pub struct DiagnosticCollector<'a> { /* private fields */ }Expand description
A diagnostic collector that accumulates diagnostics with source tracking.
Implementations§
Source§impl<'a> DiagnosticCollector<'a>
impl<'a> DiagnosticCollector<'a>
pub fn new(interner: &'a dyn TypeDatabase, file: impl Into<Arc<str>>) -> Self
Sourcepub fn diagnostics(&self) -> &[TypeDiagnostic]
pub fn diagnostics(&self) -> &[TypeDiagnostic]
Get the collected diagnostics.
Sourcepub fn take_diagnostics(&mut self) -> Vec<TypeDiagnostic>
pub fn take_diagnostics(&mut self) -> Vec<TypeDiagnostic>
Take the collected diagnostics.
Sourcepub fn type_not_assignable(
&mut self,
source: TypeId,
target: TypeId,
loc: &SourceLocation,
)
pub fn type_not_assignable( &mut self, source: TypeId, target: TypeId, loc: &SourceLocation, )
Report a type not assignable error.
Sourcepub fn property_missing(
&mut self,
prop_name: &str,
source: TypeId,
target: TypeId,
loc: &SourceLocation,
)
pub fn property_missing( &mut self, prop_name: &str, source: TypeId, target: TypeId, loc: &SourceLocation, )
Report a property missing error.
Sourcepub fn property_not_exist(
&mut self,
prop_name: &str,
type_id: TypeId,
loc: &SourceLocation,
)
pub fn property_not_exist( &mut self, prop_name: &str, type_id: TypeId, loc: &SourceLocation, )
Report a property not exist error.
Sourcepub fn argument_not_assignable(
&mut self,
arg_type: TypeId,
param_type: TypeId,
loc: &SourceLocation,
)
pub fn argument_not_assignable( &mut self, arg_type: TypeId, param_type: TypeId, loc: &SourceLocation, )
Report an argument not assignable error.
Sourcepub fn cannot_find_name(&mut self, name: &str, loc: &SourceLocation)
pub fn cannot_find_name(&mut self, name: &str, loc: &SourceLocation)
Report a cannot find name error.
Sourcepub fn argument_count_mismatch(
&mut self,
expected: usize,
got: usize,
loc: &SourceLocation,
)
pub fn argument_count_mismatch( &mut self, expected: usize, got: usize, loc: &SourceLocation, )
Report an argument count mismatch error.
Sourcepub fn to_checker_diagnostics(&self) -> Vec<Diagnostic>
pub fn to_checker_diagnostics(&self) -> Vec<Diagnostic>
Convert all collected diagnostics to checker diagnostics.
Auto Trait Implementations§
impl<'a> Freeze for DiagnosticCollector<'a>
impl<'a> !RefUnwindSafe for DiagnosticCollector<'a>
impl<'a> !Send for DiagnosticCollector<'a>
impl<'a> !Sync for DiagnosticCollector<'a>
impl<'a> Unpin for DiagnosticCollector<'a>
impl<'a> UnsafeUnpin for DiagnosticCollector<'a>
impl<'a> !UnwindSafe for DiagnosticCollector<'a>
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