File tree 3 files changed +10
-0
lines changed
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 207
207
- Add a complex macro fallback API (#2779 ).
208
208
- Add option to use DST structs for flexible arrays (--flexarray-dst, #2772 ).
209
209
- Add option to dynamically load variables (#2812 ).
210
+ - Add option in CLI to use rustified non-exhaustive enums (--rustified-non-exhaustive-enum, #2847 ).
210
211
## Changed
211
212
- Remove which and lazy-static dependencies (#2809 , #2817 ).
212
213
- Generate compile-time layout tests (#2787 ).
Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ struct BindgenCommand {
114
114
/// Mark any enum whose name matches REGEX as a Rust enum.
115
115
#[ arg( long, value_name = "REGEX" ) ]
116
116
rustified_enum : Vec < String > ,
117
+ /// Mark any enum whose name matches REGEX as a non-exhaustive Rust enum.
118
+ #[ arg( long, value_name = "REGEX" ) ]
119
+ rustified_non_exhaustive_enum : Vec < String > ,
117
120
/// Mark any enum whose name matches REGEX as a series of constants.
118
121
#[ arg( long, value_name = "REGEX" ) ]
119
122
constified_enum : Vec < String > ,
@@ -469,6 +472,7 @@ where
469
472
newtype_enum,
470
473
newtype_global_enum,
471
474
rustified_enum,
475
+ rustified_non_exhaustive_enum,
472
476
constified_enum,
473
477
constified_enum_module,
474
478
default_macro_constant_type,
@@ -635,6 +639,10 @@ where
635
639
builder = builder. rustified_enum ( regex) ;
636
640
}
637
641
642
+ for regex in rustified_non_exhaustive_enum {
643
+ builder = builder. rustified_non_exhaustive_enum ( regex) ;
644
+ }
645
+
638
646
for regex in constified_enum {
639
647
builder = builder. constified_enum ( regex) ;
640
648
}
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ impl std::fmt::Display for Formatter {
237
237
/// 2. [`bitfield_enum()`](#method.bitfield_enum)
238
238
/// 3. [`newtype_enum()`](#method.newtype_enum)
239
239
/// 4. [`rustified_enum()`](#method.rustified_enum)
240
+ /// 5. [`rustified_non_exhaustive_enum()`](#method.rustified_non_exhaustive_enum)
240
241
///
241
242
/// For each C enum, bindgen tries to match the pattern in the following order:
242
243
///
You can’t perform that action at this time.
0 commit comments