@@ -220,7 +220,7 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
220220 }
221221
222222 /// Generates the code for a field with no attributes.
223- fn generate_field_arg ( & mut self , binding_info : & BindingInfo < ' _ > ) -> ( TokenStream , TokenStream ) {
223+ fn generate_field_arg ( & mut self , binding_info : & BindingInfo < ' _ > ) -> TokenStream {
224224 let diag = & self . parent . diag ;
225225
226226 let field = binding_info. ast ( ) ;
@@ -230,16 +230,12 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
230230 let ident = field. ident . as_ref ( ) . unwrap ( ) ;
231231 let ident = format_ident ! ( "{}" , ident) ; // strip `r#` prefix, if present
232232
233- let args = quote ! {
233+ quote ! {
234234 #diag. arg(
235235 stringify!( #ident) ,
236236 #field_binding
237237 ) ;
238- } ;
239- let remove_args = quote ! {
240- #diag. remove_arg( stringify!( #ident) ) ;
241- } ;
242- ( args, remove_args)
238+ }
243239 }
244240
245241 /// Generates the necessary code for all attributes on a field.
@@ -610,7 +606,7 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
610606 let restore_args = quote ! {
611607 #diag. restore_args( ) ;
612608 } ;
613- let ( plain_args, remove_args ) : ( TokenStream , TokenStream ) = self
609+ let plain_args: TokenStream = self
614610 . variant
615611 . bindings ( )
616612 . iter ( )
@@ -623,9 +619,8 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
623619 // For #[derive(Subdiagnostic)]
624620 //
625621 // - Store args of the main diagnostic for later restore.
626- // - add args of subdiagnostic.
622+ // - Add args of subdiagnostic.
627623 // - Generate the calls, such as note, label, etc.
628- // - Remove the arguments for allowing Vec<Subdiagnostic> to be used.
629624 // - Restore the arguments for allowing main and subdiagnostic share the same fields.
630625 Ok ( quote ! {
631626 #init
@@ -634,7 +629,6 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
634629 #store_args
635630 #plain_args
636631 #calls
637- #remove_args
638632 #restore_args
639633 } )
640634 }
0 commit comments