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
.
Structsยง
- Buffy ๐
- File
With ๐Annotated Lines - Human
Emitter - Handles the writing of
HumanReadableErrorType::Default
andHumanReadableErrorType::Short
- Margin ๐
- Silent
Emitter - An emitter that does nothing when emitting a non-fatal diagnostic.
Fatal diagnostics are forwarded to
fatal_dcx
to avoid silent failures of rustc, as witnessed e.g. in issue #89358. - Underline
Parts ๐
Enumsยง
- Color
Config - Display
Suggestion ๐ - Human
Readable Error Type - Describes the way the content of the
rendered
field of the json output is generated - Output
Theme
Constantsยง
- ANONYMIZED_
LINE_ ๐NUM - BRIGHT_
BLUE ๐ - On Windows, BRIGHT_BLUE is hard to read on black. Use cyan instead.
- DEFAULT_
COLUMN_ ๐WIDTH - Default column width, used in tests and when terminal dimensions cannot be determined.
- MAX_
SUGGESTIONS - Maximum number of suggestions to be shown
- OUTPUT_
REPLACEMENTS ๐
Traitsยง
- Emitter
- Emitter trait for emitting errors.
Functionsยง
- emit_
to_ ๐destination - is_
case_ difference - Whether the original and suggested code are visually similar enough to warrant extra wording.
- is_
different - Whether the original and suggested code are the same.
- normalize_
whitespace ๐ - num_
decimal_ ๐digits - num_
overlap ๐ - overlaps ๐
- should_
show_ ๐source_ code - stderr_
destination