File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ Fix ` non_upper_case_globals ` lint firing for generated ` __match_args__ ` on complex enums.
Original file line number Diff line number Diff line change @@ -1186,19 +1186,21 @@ fn impl_complex_enum_variant_match_args(
1186
1186
variant_cls_type : & syn:: Type ,
1187
1187
field_names : & mut Vec < Ident > ,
1188
1188
) -> ( MethodAndMethodDef , syn:: ImplItemConst ) {
1189
+ let ident = format_ident ! ( "__match_args__" ) ;
1189
1190
let match_args_const_impl: syn:: ImplItemConst = {
1190
1191
let args_tp = field_names. iter ( ) . map ( |_| {
1191
1192
quote ! { & ' static str }
1192
1193
} ) ;
1193
1194
parse_quote ! {
1194
- const __match_args__: ( #( #args_tp, ) * ) = (
1195
+ #[ allow( non_upper_case_globals) ]
1196
+ const #ident: ( #( #args_tp, ) * ) = (
1195
1197
#( stringify!( #field_names) , ) *
1196
1198
) ;
1197
1199
}
1198
1200
} ;
1199
1201
1200
1202
let spec = ConstSpec {
1201
- rust_ident : format_ident ! ( "__match_args__" ) ,
1203
+ rust_ident : ident ,
1202
1204
attributes : ConstAttributes {
1203
1205
is_class_attr : true ,
1204
1206
name : None ,
You can’t perform that action at this time.
0 commit comments