File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2285,7 +2285,9 @@ impl MethodCodegen for Method {
2285
2285
/// A helper type that represents different enum variations.
2286
2286
#[ derive( Copy , Clone , PartialEq , Debug ) ]
2287
2287
pub enum EnumVariation {
2288
- /// The code for this enum will use a Rust enum
2288
+ /// The code for this enum will use a Rust enum. Note that creating this in unsafe code
2289
+ /// (including FFI) with an invalid value will invoke undefined behaviour, whether or not
2290
+ /// its marked as non_exhaustive.
2289
2291
Rust {
2290
2292
/// Indicates whether the generated struct should be `#[non_exhaustive]`
2291
2293
non_exhaustive : bool ,
Original file line number Diff line number Diff line change @@ -939,9 +939,9 @@ impl Builder {
939
939
/// This makes bindgen generate enums instead of constants. Regular
940
940
/// expressions are supported.
941
941
///
942
- /// **Use this with caution,** you probably want to use the non_exhaustive
943
- /// flavor of rust enums instead of this one. Take a look at
944
- /// https://github.com/rust-lang/rust/issues/36927 for more information .
942
+ /// **Use this with caution**, creating this in unsafe code
943
+ /// (including FFI) with an invalid value will invoke undefined behaviour.
944
+ /// You may want to use the newtype enum style instead .
945
945
pub fn rustified_enum < T : AsRef < str > > ( mut self , arg : T ) -> Builder {
946
946
self . options . rustified_enums . insert ( arg) ;
947
947
self
@@ -952,6 +952,10 @@ impl Builder {
952
952
///
953
953
/// This makes bindgen generate enums instead of constants. Regular
954
954
/// expressions are supported.
955
+ ///
956
+ /// **Use this with caution**, creating this in unsafe code
957
+ /// (including FFI) with an invalid value will invoke undefined behaviour.
958
+ /// You may want to use the newtype enum style instead.
955
959
pub fn rustified_non_exhaustive_enum < T : AsRef < str > > (
956
960
mut self ,
957
961
arg : T ,
You can’t perform that action at this time.
0 commit comments