File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -929,7 +929,14 @@ macro_rules! _decode_and_build {
929
929
$crate:: _init_and_read_len_prefixed_tlv_fields!( $stream, {
930
930
$( ( $type, $field, $fieldty) ) ,*
931
931
} ) ;
932
+ // rustc is kinda dumb about unused variable warnings when we declare a variable via an
933
+ // ident in a macro and then use it in an expr also defined in the same macro call. Thus,
934
+ // it may generate unused variable warnings for variables that are, in fact, very much
935
+ // used. Instead, we just blanket ignore unused variables here as it may be useful to write
936
+ // field names without a _ prefix for legacy fields even if we don't care about the read
937
+ // value.
932
938
$(
939
+ #[ allow( unused_variables) ]
933
940
let $field = $crate:: _init_tlv_based_struct_field!( $field, $fieldty) ;
934
941
) *
935
942
:: lightning_macros:: drop_legacy_field_definition!( $thing {
You can’t perform that action at this time.
0 commit comments