@@ -17,11 +17,11 @@ pub(crate) struct DiagnosticDerive<'a> {
1717}
1818
1919impl < ' 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 {
2121 Self {
2222 builder : DiagnosticDeriveBuilder {
2323 diag,
24- kind : DiagnosticDeriveKind :: Diagnostic { handler } ,
24+ kind : DiagnosticDeriveKind :: Diagnostic { dcx } ,
2525 } ,
2626 structure,
2727 }
@@ -36,7 +36,7 @@ impl<'a> DiagnosticDerive<'a> {
3636 let body = builder. body ( variant) ;
3737
3838 let diag = & builder. parent . diag ;
39- let DiagnosticDeriveKind :: Diagnostic { handler } = & builder. parent . kind else {
39+ let DiagnosticDeriveKind :: Diagnostic { dcx } = & builder. parent . kind else {
4040 unreachable ! ( )
4141 } ;
4242 let init = match builder. slug . value_ref ( ) {
@@ -62,7 +62,7 @@ impl<'a> DiagnosticDerive<'a> {
6262 Some ( slug) => {
6363 slugs. borrow_mut ( ) . push ( slug. clone ( ) ) ;
6464 quote ! {
65- let mut #diag = #handler . struct_diagnostic( crate :: fluent_generated:: #slug) ;
65+ let mut #diag = #dcx . struct_diagnostic( crate :: fluent_generated:: #slug) ;
6666 }
6767 }
6868 } ;
@@ -77,7 +77,7 @@ impl<'a> DiagnosticDerive<'a> {
7777 }
7878 } ) ;
7979
80- let DiagnosticDeriveKind :: Diagnostic { handler } = & builder. kind else { unreachable ! ( ) } ;
80+ let DiagnosticDeriveKind :: Diagnostic { dcx } = & builder. kind else { unreachable ! ( ) } ;
8181
8282 let mut imp = structure. gen_impl ( quote ! {
8383 gen impl <' __diagnostic_handler_sess, G >
@@ -89,7 +89,7 @@ impl<'a> DiagnosticDerive<'a> {
8989 #[ track_caller]
9090 fn into_diagnostic(
9191 self ,
92- #handler : & ' __diagnostic_handler_sess rustc_errors:: DiagCtxt
92+ #dcx : & ' __diagnostic_handler_sess rustc_errors:: DiagCtxt
9393 ) -> rustc_errors:: DiagnosticBuilder <' __diagnostic_handler_sess, G > {
9494 use rustc_errors:: IntoDiagnosticArg ;
9595 #implementation
0 commit comments