c++: mark all repr(C) structures as Copy
this should make combinations of theese structs safe
@@ -249,6 +249,7 @@ foreign_typemap!(
define_c_type!(
module = "CRustPairModule!().h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustPair!() {
first: swig_i_type!(T1),
second: swig_i_type!(T2),
@@ -287,6 +288,7 @@ foreign_typemap!(
foreign_typemap!(
define_c_type!(module = "rust_str.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustStrView {
data: *const ::std::os::raw::c_char,
len: usize,
@@ -316,6 +318,7 @@ foreign_typemap!(
foreign_typemap!(
define_c_type!(module = "rust_str.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
struct CRustString {
data: *const ::std::os::raw::c_char,
len: usize,
@@ -446,12 +449,14 @@ foreign_typemap!(
define_c_type!(
module = "rust_option.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub union CRustOptUnion!() {
data: swig_i_type!(T),
uninit: u8,
}
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustOpt!() {
val: CRustOptUnion!(),
is_some: u8,
@@ -516,6 +521,7 @@ foreign_typemap!(
define_c_type!(
module = "rust_slice.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustObjectSlice {
data: *const ::std::os::raw::c_void,
len: usize,
@@ -548,6 +554,7 @@ foreign_typemap!(
define_c_type!(
module = "rust_slice_mut.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustObjectMutSlice {
data: *mut ::std::os::raw::c_void,
len: usize,
@@ -607,6 +614,7 @@ foreign_typemap!(
define_c_type!(
module = "rust_slice.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustSlice!() {
data: *const swig_i_type!(T),
len: usize,
@@ -756,6 +764,7 @@ foreign_typemap!(
define_c_type!(
module = "rust_vec.h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustForeignVec {
data: *const ::std::os::raw::c_void,
len: usize,
@@ -826,12 +835,14 @@ foreign_typemap!(
define_c_type!(
module = "CRustResModule!().h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub union CRustResUnion!() {
ok: u8,
err: swig_i_type!(T),
}
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustRes!() {
data: CRustResUnion!(),
is_ok: u8,
@@ -873,12 +884,14 @@ foreign_typemap!(
define_c_type!(
module = "CRustResModule!().h";
#[repr(C)]
+ #[derive(Clone, Copy)]
pub union CRustResUnion!() {
ok: swig_i_type!(T1),
err: swig_i_type!(T2),
}
#[repr(C)]
+ #[derive(Clone, Copy)]
pub struct CRustRes!() {
data: CRustResUnion!(),
is_ok: u8,
