From 245e7cfd149140806ecef89d44b14e9557b297b1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 2 Jul 2021 21:10:04 -0700 Subject: [PATCH] Suppress nonstandard_macro_braces in generated code --- impl/src/expand.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/impl/src/expand.rs b/impl/src/expand.rs index fa85cbb..789eee6 100644 --- a/impl/src/expand.rs +++ b/impl/src/expand.rs @@ -115,7 +115,11 @@ fn impl_struct(input: Struct) -> TokenStream { quote! { #[allow(unused_qualifications)] impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause { - #[allow(clippy::used_underscore_binding)] + #[allow( + // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 + clippy::nonstandard_macro_braces, + clippy::used_underscore_binding, + )] fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result { #body } @@ -303,7 +307,13 @@ fn impl_enum(input: Enum) -> TokenStream { impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause { fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result { #use_as_display - #[allow(unused_variables, deprecated, clippy::used_underscore_binding)] + #[allow( + unused_variables, + deprecated, + // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 + clippy::nonstandard_macro_braces, + clippy::used_underscore_binding, + )] match #void_deref self { #(#arms,)* }