macros: use typed identifiers in subdiag derive
As in the diagnostic derive, using typed identifiers in the subdiagnostic derive improves the diagnostics of using the subdiagnostic derive as Fluent messages will be confirmed to exist at compile-time. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
99bc979403
commit
abd3467d47
9 changed files with 314 additions and 213 deletions
|
@ -265,7 +265,7 @@ struct BadTypePlus {
|
|||
#[derive(SessionSubdiagnostic)]
|
||||
pub enum BadTypePlusSub {
|
||||
#[suggestion(
|
||||
slug = "parser-add-paren",
|
||||
parser::add_paren,
|
||||
code = "{sum_with_parens}",
|
||||
applicability = "machine-applicable"
|
||||
)]
|
||||
|
@ -274,12 +274,12 @@ pub enum BadTypePlusSub {
|
|||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[label(slug = "parser-forgot-paren")]
|
||||
#[label(parser::forgot_paren)]
|
||||
ForgotParen {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[label(slug = "parser-expect-path")]
|
||||
#[label(parser::expect_path)]
|
||||
ExpectPath {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue