A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/enum.SubdiagMessage.html below:

SubdiagMessage in rustc_errors - Rust

Enum SubdiagMessageSource
pub enum SubdiagMessage {
    Str(Cow<'static, str>),
    Translated(Cow<'static, str>),
    FluentIdentifier(Cow<'static, str>),
    FluentAttr(Cow<'static, str>),
}
Expand description

Abstraction over a message in a subdiagnostic (i.e. label, note, help, etc) to support both translatable and non-translatable diagnostic messages.

Translatable messages for subdiagnostics are typically attributes attached to a larger Fluent message so messages of this type must be combined with a DiagMessage (using DiagMessage::with_subdiagnostic_message) before rendering. However, subdiagnostics from the Subdiagnostic derive refer to Fluent identifiers directly.

§

Non-translatable diagnostic message.

§

Translatable message which has already been translated eagerly.

Some diagnostics have repeated subdiagnostics where the same interpolated variables would be instantiated multiple times with different values. These subdiagnostics’ messages are translated when they are added to the parent diagnostic, producing this variant of DiagMessage.

§

Identifier of a Fluent message. Instances of this variant are generated by the Subdiagnostic derive.

§ Source§ Source§

Converts to this type from the input type.

Source§ Source§

Converts to this type from the input type.

Source§

Translating into a subdiagnostic message from a diagnostic message is a little strange - but the subdiagnostic functions (e.g. span_label) take a SubdiagMessage and the subdiagnostic derive refers to typed identifiers that are DiagMessages, so need to be able to convert between these, as much as they’ll be converted back into DiagMessage using with_subdiagnostic_message eventually. Don’t use this other than for the derive.

Source§

Converts to this type from the input type.

Source§ Source§

Converts to this type from the input type.

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant:


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