@@ -134,7 +134,6 @@ fn bitfield_inner(args: TokenStream, input: TokenStream) -> syn::Result<TokenStr
134
134
quote ! {
135
135
/// Creates a new default initialized bitfield.
136
136
#attr
137
- #[ allow( clippy:: assign_op_pattern) ]
138
137
#vis const fn new( ) -> Self {
139
138
let mut this = Self ( #from( 0 ) ) ;
140
139
#( #defaults ) *
@@ -148,7 +147,6 @@ fn bitfield_inner(args: TokenStream, input: TokenStream) -> syn::Result<TokenStr
148
147
quote ! {
149
148
#attr
150
149
impl Default for #name {
151
- #[ allow( clippy:: assign_op_pattern) ]
152
150
fn default ( ) -> Self {
153
151
let mut this = Self ( #from( 0 ) ) ;
154
152
#( #defaults ) *
@@ -177,6 +175,9 @@ fn bitfield_inner(args: TokenStream, input: TokenStream) -> syn::Result<TokenStr
177
175
#[ repr( transparent) ]
178
176
#vis struct #name( #repr) ;
179
177
178
+ #[ allow( unused_comparisons) ]
179
+ #[ allow( clippy:: unnecessary_cast) ]
180
+ #[ allow( clippy:: assign_op_pattern) ]
180
181
impl #name {
181
182
#impl_new
182
183
@@ -185,6 +186,9 @@ fn bitfield_inner(args: TokenStream, input: TokenStream) -> syn::Result<TokenStr
185
186
#( #members ) *
186
187
}
187
188
189
+ #[ allow( unused_comparisons) ]
190
+ #[ allow( clippy:: unnecessary_cast) ]
191
+ #[ allow( clippy:: assign_op_pattern) ]
188
192
#impl_default
189
193
190
194
impl From <#repr> for #name {
@@ -545,7 +549,6 @@ impl ToTokens for Member {
545
549
let this = value;
546
550
let value: #base_ty = #into;
547
551
let mask = #base_ty:: MAX >> ( #base_ty:: BITS - Self :: #bits_ident as u32 ) ;
548
- #[ allow( unused_comparisons) ]
549
552
if value > mask {
550
553
return Err ( ( ) ) ;
551
554
}
0 commit comments