pub struct ErrorTranslator { /* private fields */ }Expand description
Translates rustc error positions to Oxur source positions
Implementations§
Source§impl ErrorTranslator
impl ErrorTranslator
Sourcepub fn new(source_map: SourceMap) -> Self
pub fn new(source_map: SourceMap) -> Self
Create a new error translator with the given source map
Sourcepub fn translate_diagnostic(&self, diagnostic: &RustcDiagnostic) -> String
pub fn translate_diagnostic(&self, diagnostic: &RustcDiagnostic) -> String
Translate a rustc diagnostic to Oxur source positions
Returns a formatted error message with Oxur positions where possible. If translation is not possible, falls back to showing Rust positions.
Sourcepub fn translate_diagnostics(&self, diagnostics: &[RustcDiagnostic]) -> String
pub fn translate_diagnostics(&self, diagnostics: &[RustcDiagnostic]) -> String
Translate all diagnostics and format as a single error message
Sourcepub fn source_map(&self) -> &SourceMap
pub fn source_map(&self) -> &SourceMap
Get a reference to the source map
Auto Trait Implementations§
impl Freeze for ErrorTranslator
impl RefUnwindSafe for ErrorTranslator
impl Send for ErrorTranslator
impl Sync for ErrorTranslator
impl Unpin for ErrorTranslator
impl UnwindSafe for ErrorTranslator
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