errors: generate typed identifiers in each crate
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
f9216b7564
commit
d1fcf61117
151 changed files with 1721 additions and 1440 deletions
|
@ -65,7 +65,7 @@ pub(crate) struct MacroConstStability {
|
|||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[label(label2)]
|
||||
#[label(expand_label2)]
|
||||
pub head_span: Span,
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ pub(crate) struct MacroBodyStability {
|
|||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
#[label(label2)]
|
||||
#[label(expand_label2)]
|
||||
pub head_span: Span,
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ pub(crate) struct FeatureRemoved<'a> {
|
|||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[note(reason)]
|
||||
#[note(expand_reason)]
|
||||
pub(crate) struct FeatureRemovedReason<'a> {
|
||||
pub reason: &'a str,
|
||||
}
|
||||
|
@ -223,12 +223,12 @@ pub(crate) struct MalformedFeatureAttribute {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub(crate) enum MalformedFeatureAttributeHelp {
|
||||
#[label(expected)]
|
||||
#[label(expand_expected)]
|
||||
Label {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[suggestion(expected, code = "{suggestion}", applicability = "maybe-incorrect")]
|
||||
#[suggestion(expand_expected, code = "{suggestion}", applicability = "maybe-incorrect")]
|
||||
Suggestion {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
|
@ -306,7 +306,7 @@ pub(crate) struct IncompleteParse<'a> {
|
|||
pub kind_name: &'a str,
|
||||
|
||||
#[suggestion(
|
||||
suggestion_add_semi,
|
||||
expand_suggestion_add_semi,
|
||||
style = "verbose",
|
||||
code = ";",
|
||||
applicability = "maybe-incorrect"
|
||||
|
@ -340,7 +340,7 @@ pub(crate) struct ModuleInBlock {
|
|||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[note(note)]
|
||||
#[note(expand_note)]
|
||||
pub(crate) struct ModuleInBlockName {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue