diff options
| author | David Wood <david.wood@huawei.com> | 2022-05-24 15:09:47 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-05-30 13:38:19 +0100 |
| commit | f669b78ffc9db8352c859d8c83c244975dbf0397 (patch) | |
| tree | 4676a1dc2d4b63283e4e88eec83358381242fdc4 /compiler/rustc_errors/src/lib.rs | |
| parent | 855fc022fe879f4e3493a024f9c6b981d6317612 (diff) | |
| download | rust-f669b78ffc9db8352c859d8c83c244975dbf0397.tar.gz rust-f669b78ffc9db8352c859d8c83c244975dbf0397.zip | |
errors: simplify referring to fluent attributes
To render the message of a Fluent attribute, the identifier of the Fluent message must be known. `DiagnosticMessage::FluentIdentifier` contains both the message's identifier and optionally the identifier of an attribute. Generated constants for each attribute would therefore need to be named uniquely (amongst all error messages) or be able to refer to only the attribute identifier which will be combined with a message identifier later. In this commit, the latter strategy is implemented as part of the `Diagnostic` type's functions for adding subdiagnostics of various kinds. Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 5b9b65da343..fb02f1d68eb 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -32,7 +32,8 @@ use rustc_data_structures::sync::{self, Lock, Lrc}; use rustc_data_structures::AtomicRef; pub use rustc_error_messages::{ fallback_fluent_bundle, fluent, fluent_bundle, DiagnosticMessage, FluentBundle, - LanguageIdentifier, LazyFallbackBundle, MultiSpan, SpanLabel, DEFAULT_LOCALE_RESOURCES, + LanguageIdentifier, LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagnosticMessage, + DEFAULT_LOCALE_RESOURCES, }; pub use rustc_lint_defs::{pluralize, Applicability}; use rustc_span::source_map::SourceMap; |
