rustc_errors

Module emitter

Source
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 ๐Ÿ”’
FileWithAnnotatedLines ๐Ÿ”’
HumanEmitter
Handles the writing of HumanReadableErrorType::Default and HumanReadableErrorType::Short
Margin ๐Ÿ”’
SilentEmitter
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.
UnderlineParts ๐Ÿ”’

Enumsยง

ColorConfig
DisplaySuggestion ๐Ÿ”’
HumanReadableErrorType
Describes the way the content of the rendered field of the json output is generated
OutputTheme

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

Type Aliasesยง

Destination
DynEmitter