@@ -24,7 +24,7 @@ pub(crate) enum DiagDeriveKind {
24
24
/// Tracks persistent information required for a specific variant when building up individual calls
25
25
/// to diagnostic methods for generated diagnostic derives - both `Diagnostic` for
26
26
/// fatal/errors/warnings and `LintDiagnostic` for lints.
27
- pub ( crate ) struct DiagnosticDeriveVariantBuilder {
27
+ pub ( crate ) struct DiagDeriveVariantBuilder {
28
28
/// The kind for the entire type.
29
29
pub kind : DiagDeriveKind ,
30
30
@@ -47,7 +47,7 @@ pub(crate) struct DiagnosticDeriveVariantBuilder {
47
47
pub code : SpannedOption < ( ) > ,
48
48
}
49
49
50
- impl HasFieldMap for DiagnosticDeriveVariantBuilder {
50
+ impl HasFieldMap for DiagDeriveVariantBuilder {
51
51
fn get_field_binding ( & self , field : & String ) -> Option < & TokenStream > {
52
52
self . field_map . get ( field)
53
53
}
@@ -59,7 +59,7 @@ impl DiagDeriveKind {
59
59
/// or attributes on the type itself when input is an enum.
60
60
pub ( crate ) fn each_variant < ' s , F > ( self , structure : & mut Structure < ' s > , f : F ) -> TokenStream
61
61
where
62
- F : for < ' v > Fn ( DiagnosticDeriveVariantBuilder , & VariantInfo < ' v > ) -> TokenStream ,
62
+ F : for < ' v > Fn ( DiagDeriveVariantBuilder , & VariantInfo < ' v > ) -> TokenStream ,
63
63
{
64
64
let ast = structure. ast ( ) ;
65
65
let span = ast. span ( ) . unwrap ( ) ;
@@ -88,7 +88,7 @@ impl DiagDeriveKind {
88
88
// name will need to do.
89
89
_ => variant. ast ( ) . ident . span ( ) . unwrap ( ) ,
90
90
} ;
91
- let builder = DiagnosticDeriveVariantBuilder {
91
+ let builder = DiagDeriveVariantBuilder {
92
92
kind : self ,
93
93
span,
94
94
field_map : build_field_mapping ( variant) ,
@@ -107,7 +107,7 @@ impl DiagDeriveKind {
107
107
}
108
108
}
109
109
110
- impl DiagnosticDeriveVariantBuilder {
110
+ impl DiagDeriveVariantBuilder {
111
111
/// Generates calls to `code` and similar functions based on the attributes on the type or
112
112
/// variant.
113
113
pub ( crate ) fn preamble ( & mut self , variant : & VariantInfo < ' _ > ) -> TokenStream {
@@ -165,7 +165,7 @@ impl DiagnosticDeriveVariantBuilder {
165
165
Ok ( Some ( ( subdiag. kind , slug, subdiag. no_span ) ) )
166
166
}
167
167
168
- /// Establishes state in the `DiagnosticDeriveBuilder ` resulting from the struct
168
+ /// Establishes state in the `DiagDeriveVariantBuilder ` resulting from the struct
169
169
/// attributes like `#[diag(..)]`, such as the slug and error code. Generates
170
170
/// diagnostic builder calls for setting error code and creating note/help messages.
171
171
fn generate_structure_code_for_attr (
0 commit comments