File tree 2 files changed +14
-0
lines changed 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -735,6 +735,12 @@ impl Builder {
735
735
self
736
736
}
737
737
738
+ /// Set whether `Copy` should be derived by default.
739
+ pub fn derive_copy ( mut self , doit : bool ) -> Self {
740
+ self . options . derive_copy = doit;
741
+ self
742
+ }
743
+
738
744
/// Set whether `Debug` should be derived by default.
739
745
pub fn derive_debug ( mut self , doit : bool ) -> Self {
740
746
self . options . derive_debug = doit;
@@ -1104,6 +1110,10 @@ pub struct BindgenOptions {
1104
1110
/// True if we should generate layout tests for generated structures.
1105
1111
pub layout_tests : bool ,
1106
1112
1113
+ /// True if we should derive Copy trait implementations for C/C++ structures
1114
+ /// and types.
1115
+ pub derive_copy : bool ,
1116
+
1107
1117
/// True if we should derive Debug trait implementations for C/C++ structures
1108
1118
/// and types.
1109
1119
pub derive_debug : bool ,
@@ -1269,6 +1279,7 @@ impl Default for BindgenOptions {
1269
1279
emit_ir : false ,
1270
1280
emit_ir_graphviz : None ,
1271
1281
layout_tests : true ,
1282
+ derive_copy : true ,
1272
1283
derive_debug : true ,
1273
1284
impl_debug : false ,
1274
1285
derive_default : false ,
Original file line number Diff line number Diff line change 61
61
Arg :: with_name ( "no-layout-tests" )
62
62
. long ( "no-layout-tests" )
63
63
. help ( "Avoid generating layout tests for any type." ) ,
64
+ Arg :: with_name ( "no-derive-copy" )
65
+ . long ( "no-derive-copy" )
66
+ . help ( "Avoid deriving Copy on any type." ) ,
64
67
Arg :: with_name ( "no-derive-debug" )
65
68
. long ( "no-derive-debug" )
66
69
. help ( "Avoid deriving Debug on any type." ) ,
You can’t perform that action at this time.
0 commit comments