pub struct ErrorCollector {
errors: Vec<CompilerError>,
seen_errors: HashSet<ErrorKey>,
}
Expand description
A centralized error collector that handles error creation, formatting, and deduplication
This provides a single source of truth for error handling in the semantic analysis system, ensuring consistent error formatting and efficient deduplication.
Fields§
§errors: Vec<CompilerError>
§seen_errors: HashSet<ErrorKey>
Implementations§
Source§impl ErrorCollector
impl ErrorCollector
Sourcepub fn add_semantic_error(
&mut self,
error: SemanticAnalysisError,
context: &CompilationContext,
) -> bool
pub fn add_semantic_error( &mut self, error: SemanticAnalysisError, context: &CompilationContext, ) -> bool
Sourcepub fn add_compiler_error(&mut self, error: CompilerError) -> bool
pub fn add_compiler_error(&mut self, error: CompilerError) -> bool
Sourcepub fn into_errors(self) -> Vec<CompilerError>
pub fn into_errors(self) -> Vec<CompilerError>
Get all collected errors
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if any errors have been collected
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the number of unique errors collected
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorCollector
impl RefUnwindSafe for ErrorCollector
impl Send for ErrorCollector
impl Sync for ErrorCollector
impl Unpin for ErrorCollector
impl UnwindSafe for ErrorCollector
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