# Trait rustc_errors::EmissionGuarantee

source ·

    pub trait EmissionGuarantee: Sized {
        type EmitResult = Self;

        // Required method
        fn emit_producing_guarantee(diag: Diag<'_, Self>) -> Self::EmitResult;
    }

Expand description

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

## Provided Associated Types§

source

#### type EmitResult = Self

This exists so that bugs and fatal errors can both result in `!` (an abort) when emitted, but have different aborting behaviour.

## Required Methods§

source

#### fn emit_producing_guarantee(diag: Diag<'_, Self>) -> Self::EmitResult

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

## Object Safety§

This trait is not object safe.

## Implementations on Foreign Types§

source§

### impl EmissionGuarantee for ()

source§

#### fn emit_producing_guarantee(diag: Diag<'_, Self>) -> Self::EmitResult

## Implementors§

source§

### impl EmissionGuarantee for BugAbort

§

#### type EmitResult = !

source§

### impl EmissionGuarantee for FatalAbort

§

#### type EmitResult = !

source§

### impl EmissionGuarantee for ErrorGuaranteed

source§

### impl EmissionGuarantee for FatalError