@@ -18,7 +18,7 @@ use super::utils::SubdiagnosticVariant;
18
18
19
19
/// What kind of diagnostic is being derived - a fatal/error/warning or a lint?
20
20
#[ derive( Clone , Copy , PartialEq , Eq ) ]
21
- pub ( crate ) enum DiagnosticDeriveKind {
21
+ pub ( crate ) enum DiagDeriveKind {
22
22
Diagnostic ,
23
23
LintDiagnostic ,
24
24
}
@@ -28,7 +28,7 @@ pub(crate) enum DiagnosticDeriveKind {
28
28
/// fatal/errors/warnings and `LintDiagnostic` for lints.
29
29
pub ( crate ) struct DiagnosticDeriveVariantBuilder {
30
30
/// The kind for the entire type.
31
- pub kind : DiagnosticDeriveKind ,
31
+ pub kind : DiagDeriveKind ,
32
32
33
33
/// Initialization of format strings for code suggestions.
34
34
pub formatting_init : TokenStream ,
@@ -55,7 +55,7 @@ impl HasFieldMap for DiagnosticDeriveVariantBuilder {
55
55
}
56
56
}
57
57
58
- impl DiagnosticDeriveKind {
58
+ impl DiagDeriveKind {
59
59
/// Call `f` for the struct or for each variant of the enum, returning a `TokenStream` with the
60
60
/// tokens from `f` wrapped in an `match` expression. Emits errors for use of derive on unions
61
61
/// or attributes on the type itself when input is an enum.
@@ -316,14 +316,14 @@ impl DiagnosticDeriveVariantBuilder {
316
316
( Meta :: Path ( _) , "skip_arg" ) => return Ok ( quote ! { } ) ,
317
317
( Meta :: Path ( _) , "primary_span" ) => {
318
318
match self . kind {
319
- DiagnosticDeriveKind :: Diagnostic => {
319
+ DiagDeriveKind :: Diagnostic => {
320
320
report_error_if_not_applied_to_span ( attr, & info) ?;
321
321
322
322
return Ok ( quote ! {
323
323
diag. span( #binding) ;
324
324
} ) ;
325
325
}
326
- DiagnosticDeriveKind :: LintDiagnostic => {
326
+ DiagDeriveKind :: LintDiagnostic => {
327
327
throw_invalid_attr ! ( attr, |diag| {
328
328
diag. help( "the `primary_span` field attribute is not valid for lint diagnostics" )
329
329
} )
0 commit comments