pub trait EmissionGuarantee: Sized {
    // Required methods
    fn diagnostic_builder_emit_producing_guarantee(
        db: &mut DiagnosticBuilder<'_, Self>
    ) -> Self;
    fn make_diagnostic_builder(
        handler: &Handler,
        msg: impl Into<DiagnosticMessage>
    ) -> DiagnosticBuilder<'_, Self>;
}
Expand description

Trait for types that DiagnosticBuilder::emit can return as a “guarantee” (or “proof”) token that the emission happened.

Required Methods§

source

fn diagnostic_builder_emit_producing_guarantee( db: &mut DiagnosticBuilder<'_, Self> ) -> Self

Implementation of DiagnosticBuilder::emit, fully controlled by each impl of EmissionGuarantee, to make it impossible to create a value of Self without actually performing the emission.

source

fn make_diagnostic_builder( handler: &Handler, msg: impl Into<DiagnosticMessage> ) -> DiagnosticBuilder<'_, Self>

Creates a new DiagnosticBuilder that will return this type of guarantee.

Implementations on Foreign Types§

source§

impl EmissionGuarantee for ()

source§

impl EmissionGuarantee for !

Implementors§