Expand description
Diagnostics implementation.
Modified from rustc’s diagnostic.rs
and lib.rs.
Structs§
- BugAbort
- Marker type which enables implementation of
create_bugandemit_bugfunctions for bug diagnostics. - Code
Suggestion - A structured suggestion for code changes. Based on rustc’s CodeSuggestion structure.
- Deferred
Diagnostics - Diagnostics withheld by
DiagCtxt::defer, to be emitted withDiagCtxt::emit_deferred. - Diag
- A compiler diagnostic.
- Diag
Builder - Used for emitting structured error messages and other diagnostic information.
- Diag
Ctxt - A handler that deals with errors and other compiler output.
- Diag
Ctxt Flags - Flags that control the behaviour of a
DiagCtxt. - DiagId
- Diag ID.
- DiagMsg
- Emitted
Diagnostics - Represents all the diagnostics emitted up to a certain point.
- Error
Guaranteed - Useful type to use with
Resultindicate that an error has already been reported to the user, so no need to continue checking. - Explicit
Bug - Signifies that the compiler died with an explicit call to
.bugrather than a failed assertion, etc. - Fatal
Abort - Marker type which enables implementation of fatal diagnostics.
- Human
Buffer Emitter - Diagnostic emitter that emits diagnostics in human-readable format to a local buffer.
- Human
Emitter - Diagnostic emitter that emits to an arbitrary
io::Writewriter in human-readable format. - InMemory
Emitter - An in-memory diagnostics emitter.
- Json
Diagnostic json - A rustc-like JSON diagnostic emitted by
JsonEmitter. - Json
Diagnostic Code json - A diagnostic code in a rustc-like JSON diagnostic.
- Json
Diagnostic Span json - A source span in a rustc-like JSON diagnostic.
- Json
Diagnostic Span Line json - A source line in a rustc-like JSON diagnostic span.
- Json
Diagnostic Span Macro Expansion json - A macro expansion represented in a rustc-like JSON diagnostic span.
- Json
Emitter json - Diagnostic emitter that emits diagnostics as JSON.
- Local
Emitter - Diagnostic emitter that only stores emitted diagnostics.
- Multi
Span - A collection of
Spans. - Silent
Emitter - Diagnostic emitter.
- Solc
Diagnostic json - Source
Location json - Span
Label - A span together with some additional data.
- SubDiagnostic
- A “sub”-diagnostic attached to a parent diagnostic. For example, a note attached to an error.
- Substitution
- A substitution represents a single alternative fix consisting of multiple parts.
- Substitution
Part - A single part of a substitution, indicating a specific span to replace with a snippet.
Enums§
- Applicability
- Indicates the confidence in the correctness of a suggestion.
- Confusion
Type - Represents the type of confusion detected between original and suggested code.
- Json
Diagnostic Message json - A rustc-like JSON message emitted by
JsonEmitter::rustc_like. - Level
- Diag level.
- Severity
json - Style
- Suggestion
Style - Suggestions
- Represents the help messages seen on a diagnostic.
Traits§
- Emission
Guarantee - Trait for types that
DiagBuilder::emitcan return as a “guarantee” (or “proof”) token that the emission happened. - Emitter
- Diagnostic emitter.
Functions§
- detect_
confusion_ type - Whether the original and suggested code are visually similar enough to warrant extra wording.
- flush_
withheld - Emits every diagnostic that a
DiagCtxt::deferon any thread still withholds, in the order that they first withheld one. This is best effort, for a panic that is about to end the program, where the work that holds them cannot finish: a thread that holds a context’s lock for longer than a moment is skipped. - is_
different - Whether the original and suggested code are the same.
Type Aliases§
- DynEmitter
- Dynamic diagnostic emitter. See
Emitter.