Struct syntex_syntax::errors::DiagnosticBuilder
[−]
[src]
#[must_use] pub struct DiagnosticBuilder<'a> { // some fields omitted }
Used for emitting structured error messages and other diagnostic information.
Methods
impl<'a> DiagnosticBuilder<'a>
[src]
fn emit(&mut self)
Emit the diagnostic.
fn cancel(&mut self)
Cancel the diagnostic (a structured diagnostic must either be emitted or
cancelled or it will panic when dropped).
BEWARE: if this DiagnosticBuilder is an error, then creating it will
bump the error count on the Handler and cancelling it won't undo that.
If you want to decrement the error count you should use Handler::cancel
.
fn cancelled(&self) -> bool
fn is_fatal(&self) -> bool
fn note(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
fn span_note<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn warn(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
fn span_warn<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn help(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
fn span_help<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn span_suggestion<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str, suggestion: String) -> &mut DiagnosticBuilder<'a>
Prints out a message with a suggested edit of the code.
See diagnostic::RenderSpan::Suggestion
for more information.
fn span_end_note<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn fileline_warn<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn fileline_note<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn fileline_help<S: Into<MultiSpan>>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a>
fn span<S: Into<MultiSpan>>(&mut self, sp: S) -> &mut Self
fn code(&mut self, s: String) -> &mut Self
Trait Implementations
impl<'a> Debug for DiagnosticBuilder<'a>
[src]
impl<'a> Drop for DiagnosticBuilder<'a>
[src]
Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or we emit a bug.