@@ -17,11 +17,11 @@ pub(crate) struct DiagnosticDerive<'a> {
17
17
}
18
18
19
19
impl < ' a > DiagnosticDerive < ' a > {
20
- pub ( crate ) fn new ( diag : syn:: Ident , handler : syn:: Ident , structure : Structure < ' a > ) -> Self {
20
+ pub ( crate ) fn new ( diag : syn:: Ident , dcx : syn:: Ident , structure : Structure < ' a > ) -> Self {
21
21
Self {
22
22
builder : DiagnosticDeriveBuilder {
23
23
diag,
24
- kind : DiagnosticDeriveKind :: Diagnostic { handler } ,
24
+ kind : DiagnosticDeriveKind :: Diagnostic { dcx } ,
25
25
} ,
26
26
structure,
27
27
}
@@ -36,7 +36,7 @@ impl<'a> DiagnosticDerive<'a> {
36
36
let body = builder. body ( variant) ;
37
37
38
38
let diag = & builder. parent . diag ;
39
- let DiagnosticDeriveKind :: Diagnostic { handler } = & builder. parent . kind else {
39
+ let DiagnosticDeriveKind :: Diagnostic { dcx } = & builder. parent . kind else {
40
40
unreachable ! ( )
41
41
} ;
42
42
let init = match builder. slug . value_ref ( ) {
@@ -62,7 +62,7 @@ impl<'a> DiagnosticDerive<'a> {
62
62
Some ( slug) => {
63
63
slugs. borrow_mut ( ) . push ( slug. clone ( ) ) ;
64
64
quote ! {
65
- let mut #diag = #handler . struct_diagnostic( crate :: fluent_generated:: #slug) ;
65
+ let mut #diag = #dcx . struct_diagnostic( crate :: fluent_generated:: #slug) ;
66
66
}
67
67
}
68
68
} ;
@@ -77,7 +77,7 @@ impl<'a> DiagnosticDerive<'a> {
77
77
}
78
78
} ) ;
79
79
80
- let DiagnosticDeriveKind :: Diagnostic { handler } = & builder. kind else { unreachable ! ( ) } ;
80
+ let DiagnosticDeriveKind :: Diagnostic { dcx } = & builder. kind else { unreachable ! ( ) } ;
81
81
82
82
let mut imp = structure. gen_impl ( quote ! {
83
83
gen impl <' __diagnostic_handler_sess, G >
@@ -89,7 +89,7 @@ impl<'a> DiagnosticDerive<'a> {
89
89
#[ track_caller]
90
90
fn into_diagnostic(
91
91
self ,
92
- #handler : & ' __diagnostic_handler_sess rustc_errors:: DiagCtxt
92
+ #dcx : & ' __diagnostic_handler_sess rustc_errors:: DiagCtxt
93
93
) -> rustc_errors:: DiagnosticBuilder <' __diagnostic_handler_sess, G > {
94
94
use rustc_errors:: IntoDiagnosticArg ;
95
95
#implementation
0 commit comments