pub struct Diagnostic { /* private fields */ }
Expand description

Represents a single diagnostic message

Implementations

Create a new diagnostic message that points to Span::call_site()

Create a new diagnostic message that points to the span

Add another error message to self such that it will be emitted right after the main message.

Attach a “help” note to your main message, the note will have it’s own span on nightly.

Span

The span is ignored on stable, the note effectively inherits its parent’s (main message) span

Attach a “help” note to your main message.

Attach a note to your main message, the note will have it’s own span on nightly.

Span

The span is ignored on stable, the note effectively inherits its parent’s (main message) span

Attach a note to your main message

The message of main warning/error (no notes attached)

Abort the proc-macro’s execution and display the diagnostic.

Warnings

Warnings are not emitted on stable and beta, but this function will abort anyway.

Display the diagnostic while not aborting macro execution.

Warnings

Warnings are ignored on stable/beta

Trait Implementations

Formats the value using the given formatter. Read more

Create a new diagnostic message that points to the span_range. Read more

Add another error message to self such that it will be emitted right after the main message. Read more

Attach a “help” note to your main message, the note will have it’s own span on nightly. Read more

Attach a note to your main message, the note will have it’s own span on nightly. Read more

Write self to the given TokenStream. Read more

Convert self directly into a TokenStream object. Read more

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.