1
Fork 0

Rollup merge of #98428 - davidtwco:translation-derive-typed-identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? `````@oli-obk`````
This commit is contained in:
Matthias Krüger 2022-06-26 19:47:04 +02:00 committed by GitHub
commit 0b3b4ef2b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1003 additions and 701 deletions

View file

@ -36,7 +36,7 @@ pub fn expand_cfg(
}
#[derive(SessionDiagnostic)]
#[error(slug = "builtin-macros-requires-cfg-pattern")]
#[error(builtin_macros::requires_cfg_pattern)]
struct RequiresCfgPattern {
#[primary_span]
#[label]
@ -44,7 +44,7 @@ struct RequiresCfgPattern {
}
#[derive(SessionDiagnostic)]
#[error(slug = "builtin-macros-expected-one-cfg-pattern")]
#[error(builtin_macros::expected_one_cfg_pattern)]
struct OneCfgPattern {
#[primary_span]
span: Span,