File tree 7 files changed +17
-6
lines changed 7 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ cexpr = "0.6"
51
51
# This kinda sucks: https://github.com/rust-lang/cargo/issues/1982
52
52
clap = { version = " 2" , optional = true }
53
53
clang-sys = { version = " 1" , features = [" clang_6_0" ] }
54
+ dyn-clone = " 1"
54
55
lazycell = " 1"
55
56
lazy_static = " 1"
56
57
peeking_take_while = " 0.1.2"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl Default for MacroParsingBehavior {
25
25
26
26
/// A trait to allow configuring different kinds of types in different
27
27
/// situations.
28
- pub trait ParseCallbacks : fmt:: Debug + UnwindSafe {
28
+ pub trait ParseCallbacks : fmt:: Debug + UnwindSafe + dyn_clone :: DynClone {
29
29
/// This function will be run on every macro that is identified.
30
30
fn will_parse_macro ( & self , _name : & str ) -> MacroParsingBehavior {
31
31
MacroParsingBehavior :: Default
@@ -104,3 +104,5 @@ pub trait ParseCallbacks: fmt::Debug + UnwindSafe {
104
104
vec ! [ ]
105
105
}
106
106
}
107
+
108
+ dyn_clone:: clone_trait_object!( ParseCallbacks ) ;
Original file line number Diff line number Diff line change @@ -1687,6 +1687,7 @@ impl Drop for Diagnostic {
1687
1687
}
1688
1688
1689
1689
/// A file which has not been saved to disk.
1690
+ #[ derive( Clone ) ]
1690
1691
pub struct UnsavedFile {
1691
1692
x : CXUnsavedFile ,
1692
1693
/// The name of the unsaved file. Kept here to avoid leaving dangling pointers in
Original file line number Diff line number Diff line change 1
1
/// Generating build depfiles from parsed bindings.
2
2
use std:: { collections:: BTreeSet , path:: PathBuf } ;
3
3
4
- #[ derive( Debug ) ]
4
+ #[ derive( Clone , Debug ) ]
5
5
pub ( crate ) struct DepfileSpec {
6
6
pub output_module : String ,
7
7
pub depfile_path : PathBuf ,
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ impl Default for CodegenConfig {
219
219
/// End-users of the crate may need to set the `BINDGEN_EXTRA_CLANG_ARGS` environment variable to
220
220
/// add additional arguments. For example, to build against a different sysroot a user could set
221
221
/// `BINDGEN_EXTRA_CLANG_ARGS` to `--sysroot=/path/to/sysroot`.
222
- #[ derive( Debug , Default ) ]
222
+ #[ derive( Clone , Debug , Default ) ]
223
223
pub struct Builder {
224
224
options : BindgenOptions ,
225
225
input_headers : Vec < String > ,
@@ -1663,7 +1663,7 @@ impl Builder {
1663
1663
}
1664
1664
1665
1665
/// Configuration options for generated bindings.
1666
- #[ derive( Debug ) ]
1666
+ #[ derive( Clone , Debug ) ]
1667
1667
struct BindgenOptions {
1668
1668
/// The set of types that have been blocklisted and should not appear
1669
1669
/// anywhere in the generated code.
@@ -2656,7 +2656,7 @@ fn get_target_dependent_env_var(var: &str) -> Option<String> {
2656
2656
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks))
2657
2657
/// .generate();
2658
2658
/// ```
2659
- #[ derive( Debug ) ]
2659
+ #[ derive( Clone , Debug ) ]
2660
2660
pub struct CargoCallbacks ;
2661
2661
2662
2662
impl callbacks:: ParseCallbacks for CargoCallbacks {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use regex::RegexSet as RxSet;
4
4
use std:: cell:: Cell ;
5
5
6
6
/// A dynamic set of regular expressions.
7
- #[ derive( Debug , Default ) ]
7
+ #[ derive( Clone , Debug , Default ) ]
8
8
pub struct RegexSet {
9
9
items : Vec < String > ,
10
10
/// Whether any of the items in the set was ever matched. The length of this
You can’t perform that action at this time.
0 commit comments