Crate rustc_error_messages

Crate rustc_error_messages 

Source

Re-exports§

pub use fluent_bundle;

Modules§

diagnostic_impls 🔒

Macros§

into_diag_arg_using_display
langid

Structs§

DiagArgFromDisplay
FluentArgs
Fluent messages can use arguments in order to programmatically add values to a translated string. For instance, in a localized application you may wish to display a user’s email count. This could be done with the following message.
LanguageIdentifier
LanguageIdentifier is a core struct representing a Unicode Language Identifier.
MultiSpan
A collection of Spans.
SpanLabel
A span together with some additional data.

Enums§

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.
FluentError
Core error type for Fluent runtime system.
FluentValue
The FluentValue enum represents values which can be formatted to a String.
SubdiagMessage
Abstraction over a message in a subdiagnostic (i.e. label, note, help, etc) to support both translatable and non-translatable diagnostic messages.
TranslationBundleError

Traits§

FluentType
Custom types can implement the FluentType trait in order to generate a string value for use in the message generation process.
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.

Functions§

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.
fluent_value_from_str_list_sep_by_and
icu_locale_from_unic_langid 🔒
new_bundle 🔒
register_functions 🔒

Type Aliases§

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.
DiagArgName
Name of a diagnostic argument.
FluentBundle
FluentId 🔒
Identifier for the Fluent message/attribute corresponding to a diagnostic message.
LazyFallbackBundle
Type alias for the result of fallback_fluent_bundle - a reference-counted pointer to a lazily evaluated fluent bundle.