Expand description
The current rustc diagnostics emitter.
An Emitter takes care of generating the output from a Diag struct.
There are various Emitter implementations that generate different output formats such as
JSON and human readable output.
The output types are defined in rustc_session::config::ErrorOutputType.
Re-exportsยง
use std::borrow::Cow;๐use std::io;๐use std::io::IsTerminal;๐use std::iter;๐use std::path::Path;๐use anstream::AutoStream;๐use anstream::ColorChoice;๐use anstyle::AnsiColor;๐use anstyle::Effects;๐use rustc_data_structures::fx::FxIndexSet;๐use rustc_data_structures::sync::DynSend;๐use rustc_error_messages::DiagArgMap;๐use rustc_span::hygiene::ExpnKind;๐use rustc_span::hygiene::MacroKind;๐use rustc_span::source_map::SourceMap;๐use rustc_span::FileName;๐use rustc_span::SourceFile;๐use rustc_span::Span;๐use tracing::debug;๐use tracing::warn;๐use crate::formatting::format_diag_message;๐use crate::timings::TimingRecord;๐use crate::CodeSuggestion;๐use crate::DiagInner;๐use crate::DiagMessage;๐use crate::Level;๐use crate::MultiSpan;๐use crate::Style;๐use crate::Subdiag;๐use crate::Sublevel;๐use crate::SuggestionStyle;๐use std::io::prelude::*;๐
Structsยง
- Buffy ๐
- Emitter
With Note - An emitter that adds a note to each diagnostic.
- Human
Readable Error Type - Describes the way the content of the
renderedfield of the json output is generated - Silent
Emitter
Enumsยง
- Color
Config - Confusion
Type - Represents the type of confusion detected between original and suggested code.
- Output
Theme - Timing
Event
Constantsยง
- MAX_
SUGGESTIONS - Maximum number of suggestions to be shown
- OUTPUT_
REPLACEMENTS ๐
Traitsยง
- Emitter
- Emitter trait for emitting errors and other structured information.
Functionsยง
- detect_
confusion_ type - Whether the original and suggested code are visually similar enough to warrant extra wording.
- get_
stderr_ color_ choice - is_
different - Whether the original and suggested code are the same.
- normalize_
whitespace ๐ - should_
show_ ๐source_ code - stderr_
destination