Showing content from https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/index.html below:
rustc_errors - Rust
Expand description
Diagnostics creation and emission for rustc
.
This module contains the code for creating and emitting diagnostics.
-
pub use emitter::ColorConfig;
-
pub use rustc_error_messages::fluent_bundle;
-
pub use codes::*;
-
annotate_snippet_emitter_writer
-
Emit diagnostics using the
annotate-snippets
library
-
codes
-
This module defines the following.
-
diagnostic ð
-
diagnostic_impls ð
-
emitter
-
The current rustc diagnostics emitter.
-
error
-
json
-
A JSON emitter for errors.
-
lock ð
-
Bindings to acquire a global named lock.
-
markdown
-
A simple markdown parser that can write formatted text to the terminal
-
registry
-
snippet ð
-
styled_buffer ð
-
timings
-
translation
-
into_diag_arg_using_display
-
pluralize
-
struct_span_code_err
-
BugAbort
-
Marker type which enables implementation of
create_bug
and emit_bug
functions for bug diagnostics.
-
CodeSuggestion
-
ColorSpec
-
A color specification.
-
DelayedBugPanic
-
Signifies that the compiler died due to a delayed bug rather than a failed assertion, etc.
-
DelayedDiagInner ð
-
Diag
-
Used for emitting structured error messages and other diagnostic information. Wraps a
DiagInner
, adding some useful things.
-
DiagArgFromDisplay
-
DiagCtxt
-
A
DiagCtxt
deals with errors and other compiler output. Certain errors (fatal, bug, unimpl) may cause immediate exit, others log errors for later reporting.
-
DiagCtxtFlags
-
DiagCtxtHandle
-
DiagCtxtInner ð
-
This inner struct exists to keep it all behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
-
DiagInner
-
The main part of a diagnostic. Note that
Diag
, which wraps this type, is used for most operations, and should be used instead whenever possible. This type should only be used when Diag
âs lifetime causes difficulties, e.g. when storing diagnostics within DiagCtxt
.
-
DiagStyledString
-
DiagSymbolList
-
ElidedLifetimeInPathSubdiag
-
ErrorGuaranteed
-
Useful type to use with
Result<>
indicate that an error has already been reported to the user, so no need to continue checking.
-
ExpectedLifetimeParameter
-
ExplicitBug
-
Signifies that the compiler died with an explicit call to
.bug
or .span_bug
rather than a failed assertion, etc.
-
FatalAbort
-
Marker type which enables implementation of
create_fatal
and emit_fatal
functions for fatal diagnostics.
-
FatalError
-
Used as a return value to signify a fatal error occurred.
-
FatalErrorMarker
-
This is a marker for a fatal compiler error used with
resume_unwind
.
-
IndicateAnonymousLifetime
-
LanguageIdentifier
-
LanguageIdentifier
is a core struct representing a Unicode Language Identifier.
-
MultiSpan
-
A collection of
Span
s.
-
SingleLabelManySpans
-
Utility struct used to apply a single label while highlighting multiple spans
-
SpanLabel
-
A span together with some additional data.
-
StringPart
-
Subdiag
-
A âsubâ-diagnostic attached to a parent diagnostic. For example, a note attached to an error.
-
Substitution
-
See the docs on
CodeSuggestion::substitutions
-
SubstitutionHighlight ð
-
Used to translate between
Span
s and byte positions within a single output line in highlighted code of structured suggestions.
-
SubstitutionPart
-
Applicability
-
Indicates the confidence in the correctness of a suggestion.
-
Color
-
The set of available colors for the terminal foreground/background.
-
DiagArgValue
-
Simplified version of
FluentValue
that can implement Encodable
and Decodable
. Converted to a FluentValue
by the emitter to be used in diagnostic translation.
-
DiagMessage
-
Abstraction over a message in a diagnostic to support both translatable and non-translatable diagnostic messages.
-
Level
-
StashKey
-
A key denoting where from a diagnostic was stashed.
-
Style
-
SubdiagMessage
-
Abstraction over a message in a subdiagnostic (i.e. label, note, help, etc) to support both translatable and non-translatable diagnostic messages.
-
SuggestionStyle
-
Suggestions
-
Represents the help messages seen on a diagnostic.
-
TerminalUrl
-
DEFAULT_LOCALE_RESOURCE
-
Raw content of Fluent resource for this crate, generated by
fluent_messages
macro, imported by rustc_driver
to include all cratesâ resources in one bundle.
-
TRACK_DIAGNOSTIC
-
Diagnostics emitted by
DiagCtxtInner::emit_diagnostic
are passed through this function. Used for tracking by incremental, to replay diagnostics as necessary.
-
Diagnostic
-
Trait implemented by error types. This is rarely implemented manually. Instead, use
#[derive(Diagnostic)]
â see rustc_macros::Diagnostic.
-
EmissionGuarantee
-
Trait for types that
Diag::emit
can return as a âguaranteeâ (or âproofâ) token that the emission happened.
-
IntoDiagArg
-
Converts a value of a type into a
DiagArg
(typically a field of an Diag
struct). Implemented as a custom trait rather than From
so that it is implemented on the type being converted rather than on DiagArgValue
, which enables types from other rustc_*
crates to implement this.
-
LintDiagnostic
-
Trait implemented by lint types. This should not be implemented manually. Instead, use
#[derive(LintDiagnostic)]
â see rustc_macros::LintDiagnostic.
-
LintEmitter
-
Used to avoid depending on
rustc_middle
in rustc_attr_parsing
. Always the TyCtxt
.
-
Subdiagnostic
-
Trait implemented by error types. This should not be implemented manually. Instead, use
#[derive(Subdiagnostic)]
â see rustc_macros::Subdiagnostic.
-
WriteColor
-
This trait describes the behavior of writers that support colored output.
-
a_or_an
-
Grammatical tool for displaying messages to end users in a nice form.
-
as_substr ð
-
Given an original string like
AACC
, and a suggestion like AABBCC
, try to detect the case where a substring of the suggestion is âsandwichedâ in the original, like BB
is. Return the length of the prefix, the âtrimmedâ suggestion, and the length of the suffix.
-
default_track_diagnostic ð
-
elided_lifetime_in_path_suggestion
-
fallback_fluent_bundle
-
Return the default
FluentBundle
with standard âen-USâ diagnostic messages.
-
fluent_bundle
-
Returns Fluent bundle with the userâs locale resources from
$sysroot/share/locale/$requested_locale/*.ftl
.
-
listify
-
Grammatical tool for displaying messages to end users in a nice form.
-
report_ambiguity_error
-
DiagArg
-
Simplified version of
FluentArg
that can implement Encodable
and Decodable
. Collection of DiagArg
are converted to FluentArgs
(consuming the collection) at the start of diagnostic emission.
-
DiagArgMap
-
DiagArgName
-
Name of a diagnostic argument.
-
FluentBundle
-
LazyFallbackBundle
-
Type alias for the result of
fallback_fluent_bundle
- a reference-counted pointer to a lazily evaluated fluent bundle.
-
PResult
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4