[][src]Trait rustc_errors::emitter::Emitter

pub trait Emitter {
    pub fn emit_diagnostic(&mut self, diag: &Diagnostic);
pub fn source_map(&self) -> Option<&Lrc<SourceMap>>; pub fn emit_artifact_notification(
        &mut self,
        _path: &Path,
        _artifact_type: &str
    ) { ... }
pub fn emit_future_breakage_report(
        &mut self,
        _diags: Vec<(FutureBreakage, Diagnostic)>
    ) { ... }
pub fn should_show_explain(&self) -> bool { ... }
pub fn supports_color(&self) -> bool { ... }
pub fn primary_span_formatted<'a>(
        &mut self,
        diag: &'a Diagnostic
    ) -> (MultiSpan, &'a [CodeSuggestion]) { ... }
pub fn fix_multispans_in_extern_macros_and_render_macro_backtrace(
        &self,
        source_map: &Option<Lrc<SourceMap>>,
        span: &mut MultiSpan,
        children: &mut Vec<SubDiagnostic>,
        level: &Level,
        backtrace: bool
    ) { ... }
pub fn render_multispans_macro_backtrace(
        &self,
        span: &mut MultiSpan,
        children: &mut Vec<SubDiagnostic>,
        backtrace: bool
    ) { ... }
pub fn render_multispan_macro_backtrace(
        &self,
        span: &mut MultiSpan,
        always_backtrace: bool
    ) { ... }
pub fn fix_multispans_in_extern_macros(
        &self,
        source_map: &Option<Lrc<SourceMap>>,
        span: &mut MultiSpan,
        children: &mut Vec<SubDiagnostic>
    ) { ... }
pub fn fix_multispan_in_extern_macros(
        &self,
        source_map: &Option<Lrc<SourceMap>>,
        span: &mut MultiSpan
    ) { ... } }

Emitter trait for emitting errors.

Required methods

pub fn emit_diagnostic(&mut self, diag: &Diagnostic)[src]

Emit a structured diagnostic.

pub fn source_map(&self) -> Option<&Lrc<SourceMap>>[src]

Loading content...

Provided methods

pub fn emit_artifact_notification(&mut self, _path: &Path, _artifact_type: &str)[src]

Emit a notification that an artifact has been output. This is currently only supported for the JSON format, other formats can, and will, simply ignore it.

pub fn emit_future_breakage_report(
    &mut self,
    _diags: Vec<(FutureBreakage, Diagnostic)>
)
[src]

pub fn should_show_explain(&self) -> bool[src]

Checks if should show explanations about "rustc --explain"

pub fn supports_color(&self) -> bool[src]

Checks if we can use colors in the current output stream.

pub fn primary_span_formatted<'a>(
    &mut self,
    diag: &'a Diagnostic
) -> (MultiSpan, &'a [CodeSuggestion])
[src]

Formats the substitutions of the primary_span

The are a lot of conditions to this method, but in short:

  • If the current Diagnostic has only one visible CodeSuggestion, we format the help suggestion depending on the content of the substitutions. In that case, we return the modified span only.

  • If the current Diagnostic has multiple suggestions, we return the original primary_span and the original suggestions.

pub fn fix_multispans_in_extern_macros_and_render_macro_backtrace(
    &self,
    source_map: &Option<Lrc<SourceMap>>,
    span: &mut MultiSpan,
    children: &mut Vec<SubDiagnostic>,
    level: &Level,
    backtrace: bool
)
[src]

pub fn render_multispans_macro_backtrace(
    &self,
    span: &mut MultiSpan,
    children: &mut Vec<SubDiagnostic>,
    backtrace: bool
)
[src]

pub fn render_multispan_macro_backtrace(
    &self,
    span: &mut MultiSpan,
    always_backtrace: bool
)
[src]

pub fn fix_multispans_in_extern_macros(
    &self,
    source_map: &Option<Lrc<SourceMap>>,
    span: &mut MultiSpan,
    children: &mut Vec<SubDiagnostic>
)
[src]

pub fn fix_multispan_in_extern_macros(
    &self,
    source_map: &Option<Lrc<SourceMap>>,
    span: &mut MultiSpan
)
[src]

Loading content...

Implementors

impl Emitter for AnnotateSnippetEmitterWriter[src]

pub fn emit_diagnostic(&mut self, diag: &Diagnostic)[src]

The entry point for the diagnostics generation

impl Emitter for EmitterWriter[src]

impl Emitter for SilentEmitter[src]

impl Emitter for JsonEmitter[src]

Loading content...