Struct syntex_errors::diagnostic_builder::DiagnosticBuilder [] [src]

#[must_use]
pub struct DiagnosticBuilder<'a> { /* fields omitted */ }

Used for emitting structured error messages and other diagnostic information.

Methods

impl<'a> DiagnosticBuilder<'a>
[src]

Emit the diagnostic.

Add a span/label to be included in the resulting snippet. This is pushed onto the MultiSpan that was created when the diagnostic was first built. If you don't call this function at all, and you just supplied a Span to create the diagnostic, then the snippet will just include that Span, which is called the primary span.

Convenience function for internal use, clients should use one of the struct_* methods on Handler.

Convenience function for internal use, clients should use one of the struct_* methods on Handler.

Methods from Deref<Target = Diagnostic>

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.

Add a span/label to be included in the resulting snippet. This is pushed onto the MultiSpan that was created when the diagnostic was first built. If you don't call this function at all, and you just supplied a Span to create the diagnostic, then the snippet will just include that Span, which is called the primary span.

Prints out a message with a suggested edit of the code.

See diagnostic::CodeSuggestion for more information.

Used by a lint. Copies over all details but the "main message".

Trait Implementations

impl<'a> Clone for DiagnosticBuilder<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Deref for DiagnosticBuilder<'a>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a> DerefMut for DiagnosticBuilder<'a>
[src]

The method called to mutably dereference a value

impl<'a> Debug for DiagnosticBuilder<'a>
[src]

Formats the value using the given formatter.

impl<'a> Drop for DiagnosticBuilder<'a>
[src]

Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or we emit a bug.

A method called when the value goes out of scope. Read more