File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2023,7 +2023,8 @@ impl CodeGenerator for CompInfo {
2023
2023
attributes. push ( attributes:: derives ( & derives) )
2024
2024
}
2025
2025
2026
- if item. annotations ( ) . must_use_type ( ) || ctx. must_use_type_by_name ( item) {
2026
+ if item. annotations ( ) . must_use_type ( ) || ctx. must_use_type_by_name ( item)
2027
+ {
2027
2028
attributes. push ( attributes:: must_use ( ) ) ;
2028
2029
}
2029
2030
@@ -3002,6 +3003,11 @@ impl CodeGenerator for Enum {
3002
3003
attrs. push ( attributes:: doc ( comment) ) ;
3003
3004
}
3004
3005
3006
+ if item. annotations ( ) . must_use_type ( ) || ctx. must_use_type_by_name ( item)
3007
+ {
3008
+ attrs. push ( attributes:: must_use ( ) ) ;
3009
+ }
3010
+
3005
3011
if !variation. is_const ( ) {
3006
3012
let mut derives = derives_of_item ( item, ctx) ;
3007
3013
// For backwards compat, enums always derive Clone/Eq/PartialEq/Hash, even
Original file line number Diff line number Diff line change @@ -949,7 +949,7 @@ where
949
949
builder = builder. no_hash ( regex) ;
950
950
}
951
951
}
952
-
952
+
953
953
if let Some ( must_use_type) = matches. values_of ( "must-use-type" ) {
954
954
for regex in must_use_type {
955
955
builder = builder. must_use_type ( regex) ;
You can’t perform that action at this time.
0 commit comments