diff options
24 files changed, 42 insertions, 41 deletions
diff --git a/tests/expectations/tests/issue-801-opaque-sloppiness.rs b/tests/expectations/tests/issue-801-opaque-sloppiness.rs index b1462ca9..dbf21cf9 100644 --- a/tests/expectations/tests/issue-801-opaque-sloppiness.rs +++ b/tests/expectations/tests/issue-801-opaque-sloppiness.rs @@ -10,7 +10,7 @@ pub struct A { _unused: [u8; 0], } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct B { pub _bindgen_opaque_blob: u8, } @@ -29,7 +29,7 @@ extern "C" { pub static mut B_a: A; } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct C { pub b: B, } diff --git a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs index debfd32e..ed7d8a73 100644 --- a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs +++ b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Pupper { pub _address: u8, } @@ -20,7 +20,7 @@ impl Clone for Pupper { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Doggo { pub _address: u8, } @@ -35,7 +35,7 @@ impl Clone for Doggo { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct SuchWow { pub _address: u8, } @@ -50,7 +50,7 @@ impl Clone for SuchWow { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Opaque { pub _bindgen_opaque_blob: u8, } @@ -89,7 +89,7 @@ extern "C" { pub static mut Opaque_MAJESTIC_AF: Doggo; } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Whitelisted { pub some_member: Opaque, } diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs index 587fafe3..0a77b24e 100644 --- a/tests/expectations/tests/jsval_layout_opaque.rs +++ b/tests/expectations/tests/jsval_layout_opaque.rs @@ -84,7 +84,7 @@ pub union jsval_layout { _bindgen_union_align: u64, } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct jsval_layout__bindgen_ty_1 { pub _bitfield_1: u64, pub __bindgen_align: [u64; 0usize], diff --git a/tests/expectations/tests/jsval_layout_opaque_1_0.rs b/tests/expectations/tests/jsval_layout_opaque_1_0.rs index fd71f862..563124d5 100644 --- a/tests/expectations/tests/jsval_layout_opaque_1_0.rs +++ b/tests/expectations/tests/jsval_layout_opaque_1_0.rs @@ -34,6 +34,7 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> { impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> { fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true } } +impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { } pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47; pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327; pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328; @@ -114,7 +115,7 @@ pub struct jsval_layout { pub bindgen_union_field: u64, } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct jsval_layout__bindgen_ty_1 { pub _bitfield_1: u64, pub __bindgen_align: [u64; 0usize], @@ -220,12 +221,12 @@ impl jsval_layout__bindgen_ty_1 { } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct jsval_layout__bindgen_ty_2 { pub payload: jsval_layout__bindgen_ty_2__bindgen_ty_1, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct jsval_layout__bindgen_ty_2__bindgen_ty_1 { pub i32: __BindgenUnionField<i32>, pub u32: __BindgenUnionField<u32>, diff --git a/tests/expectations/tests/opaque-template-inst-member-2.rs b/tests/expectations/tests/opaque-template-inst-member-2.rs index 848babe4..53122ba6 100644 --- a/tests/expectations/tests/opaque-template-inst-member-2.rs +++ b/tests/expectations/tests/opaque-template-inst-member-2.rs @@ -7,12 +7,12 @@ /// This is like `opaque-template-inst-member.hpp` except exercising the cases /// where we are OK to derive Debug/Hash/PartialEq. #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct OpaqueTemplate { } /// Should derive Debug/Hash/PartialEq. #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct ContainsOpaqueTemplate { pub mBlah: u32, pub mBaz: ::std::os::raw::c_int, @@ -41,7 +41,7 @@ impl Clone for ContainsOpaqueTemplate { } /// Should also derive Debug/Hash/PartialEq. #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct InheritsOpaqueTemplate { pub _base: u8, pub wow: *mut ::std::os::raw::c_char, diff --git a/tests/expectations/tests/opaque-template-inst-member.rs b/tests/expectations/tests/opaque-template-inst-member.rs index bab28917..32995873 100644 --- a/tests/expectations/tests/opaque-template-inst-member.rs +++ b/tests/expectations/tests/opaque-template-inst-member.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Default, Copy, Clone, Hash, PartialEq)] +#[derive(Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct OpaqueTemplate { } /// This should not end up deriving Debug/Hash/PartialEq because its `mBlah` field cannot derive diff --git a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs index 6fc0f840..7bf657ed 100644 --- a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs +++ b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs @@ -12,7 +12,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; #[repr(C)] - #[derive(Debug, Copy, Clone, Hash, PartialEq)] + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Template<T> { pub member: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -21,7 +21,7 @@ pub mod root { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] - #[derive(Debug, Default, Copy, Hash, PartialEq)] + #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Foo { pub c: ::std::os::raw::c_char, } @@ -41,7 +41,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Default, Copy, Hash, PartialEq)] + #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Bar { pub i: ::std::os::raw::c_int, } @@ -61,7 +61,7 @@ pub mod root { fn clone(&self) -> Self { *self } } #[repr(C)] - #[derive(Debug, Copy, Hash, PartialEq)] + #[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct ContainsInstantiation { pub not_opaque: root::zoidberg::Template<root::zoidberg::Foo>, } @@ -89,7 +89,7 @@ pub mod root { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] - #[derive(Debug, Default, Copy, Hash, PartialEq)] + #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct ContainsOpaqueInstantiation { pub opaque: u32, } diff --git a/tests/expectations/tests/opaque-template-instantiation.rs b/tests/expectations/tests/opaque-template-instantiation.rs index 89f42e53..010186a5 100644 --- a/tests/expectations/tests/opaque-template-instantiation.rs +++ b/tests/expectations/tests/opaque-template-instantiation.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Template<T> { pub member: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -14,7 +14,7 @@ impl <T> Default for Template<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct ContainsInstantiation { pub not_opaque: Template<::std::os::raw::c_char>, } @@ -39,7 +39,7 @@ impl Default for ContainsInstantiation { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct ContainsOpaqueInstantiation { pub opaque: u32, } diff --git a/tests/expectations/tests/opaque-tracing.rs b/tests/expectations/tests/opaque-tracing.rs index a5e0dc2b..8c80c83a 100644 --- a/tests/expectations/tests/opaque-tracing.rs +++ b/tests/expectations/tests/opaque-tracing.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Container { pub _bindgen_opaque_blob: [u32; 2usize], } diff --git a/tests/expectations/tests/opaque_in_struct.rs b/tests/expectations/tests/opaque_in_struct.rs index 29da8da4..a4ba4649 100644 --- a/tests/expectations/tests/opaque_in_struct.rs +++ b/tests/expectations/tests/opaque_in_struct.rs @@ -6,7 +6,7 @@ /// <div rustbindgen opaque> #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct opaque { pub _bindgen_opaque_blob: u32, } @@ -21,7 +21,7 @@ impl Clone for opaque { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct container { pub contained: opaque, } diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs index 7988a261..bd2a624e 100644 --- a/tests/expectations/tests/opaque_pointer.rs +++ b/tests/expectations/tests/opaque_pointer.rs @@ -6,7 +6,7 @@ /// <div rustbindgen opaque></div> #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct OtherOpaque { pub _bindgen_opaque_blob: u32, } @@ -22,7 +22,7 @@ impl Clone for OtherOpaque { } /// <div rustbindgen opaque></div> #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Opaque { } #[repr(C)] diff --git a/tests/expectations/tests/opaque_typedef.rs b/tests/expectations/tests/opaque_typedef.rs index 09717396..96df276c 100644 --- a/tests/expectations/tests/opaque_typedef.rs +++ b/tests/expectations/tests/opaque_typedef.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct RandomTemplate { pub _address: u8, } diff --git a/tests/headers/issue-801-opaque-sloppiness.hpp b/tests/headers/issue-801-opaque-sloppiness.hpp index 72d234fb..67858634 100644 --- a/tests/headers/issue-801-opaque-sloppiness.hpp +++ b/tests/headers/issue-801-opaque-sloppiness.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --opaque-type "B" --whitelist-type "C" --with-derive-hash --with-derive-partialeq +// bindgen-flags: --opaque-type "B" --whitelist-type "C" --with-derive-hash --with-derive-partialeq --with-derive-eq class A; diff --git a/tests/headers/issue-807-opaque-types-methods-being-generated.hpp b/tests/headers/issue-807-opaque-types-methods-being-generated.hpp index e66ccc5e..91f221ce 100644 --- a/tests/headers/issue-807-opaque-types-methods-being-generated.hpp +++ b/tests/headers/issue-807-opaque-types-methods-being-generated.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --whitelist-type Whitelisted --opaque-type Opaque --with-derive-hash --with-derive-partialeq -- -std=c++11 +// bindgen-flags: --whitelist-type Whitelisted --opaque-type Opaque --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11 // These types are not explicitly whitelisted, but are reachable through the // opaque type. diff --git a/tests/headers/jsval_layout_opaque.hpp b/tests/headers/jsval_layout_opaque.hpp index 6a730e8e..09b5bebe 100644 --- a/tests/headers/jsval_layout_opaque.hpp +++ b/tests/headers/jsval_layout_opaque.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq // bindgen-flags: -- -std=c++11 /** diff --git a/tests/headers/jsval_layout_opaque_1_0.hpp b/tests/headers/jsval_layout_opaque_1_0.hpp index dd598274..61eefe1e 100644 --- a/tests/headers/jsval_layout_opaque_1_0.hpp +++ b/tests/headers/jsval_layout_opaque_1_0.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq +// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq // bindgen-flags: -- -std=c++11 /** diff --git a/tests/headers/opaque-template-inst-member-2.hpp b/tests/headers/opaque-template-inst-member-2.hpp index 09a4ea05..85b648ff 100644 --- a/tests/headers/opaque-template-inst-member-2.hpp +++ b/tests/headers/opaque-template-inst-member-2.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq +// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq --with-derive-eq /// This is like `opaque-template-inst-member.hpp` except exercising the cases /// where we are OK to derive Debug/Hash/PartialEq. diff --git a/tests/headers/opaque-template-inst-member.hpp b/tests/headers/opaque-template-inst-member.hpp index 2586850f..4cb3dd72 100644 --- a/tests/headers/opaque-template-inst-member.hpp +++ b/tests/headers/opaque-template-inst-member.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq +// bindgen-flags: --opaque-type 'OpaqueTemplate' --with-derive-hash --with-derive-partialeq --with-derive-eq template<typename T> class OpaqueTemplate { diff --git a/tests/headers/opaque-template-instantiation-namespaced.hpp b/tests/headers/opaque-template-instantiation-namespaced.hpp index 0c78fc7d..e1cadcc2 100644 --- a/tests/headers/opaque-template-instantiation-namespaced.hpp +++ b/tests/headers/opaque-template-instantiation-namespaced.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --enable-cxx-namespaces --opaque-type 'zoidberg::Template<zoidberg::Bar>' --with-derive-hash --with-derive-partialeq -- -std=c++14 +// bindgen-flags: --enable-cxx-namespaces --opaque-type 'zoidberg::Template<zoidberg::Bar>' --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14 namespace zoidberg { diff --git a/tests/headers/opaque-template-instantiation.hpp b/tests/headers/opaque-template-instantiation.hpp index f0c860f0..fff49af2 100644 --- a/tests/headers/opaque-template-instantiation.hpp +++ b/tests/headers/opaque-template-instantiation.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --opaque-type 'Template<int>' --with-derive-hash --with-derive-partialeq -- -std=c++14 +// bindgen-flags: --opaque-type 'Template<int>' --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14 template <typename T> class Template { diff --git a/tests/headers/opaque-tracing.hpp b/tests/headers/opaque-tracing.hpp index 5ea72947..326ebbe7 100644 --- a/tests/headers/opaque-tracing.hpp +++ b/tests/headers/opaque-tracing.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --opaque-type=.* --whitelist-function=foo --with-derive-hash --with-derive-partialeq +// bindgen-flags: --opaque-type=.* --whitelist-function=foo --with-derive-hash --with-derive-partialeq --with-derive-eq class Container; diff --git a/tests/headers/opaque_in_struct.hpp b/tests/headers/opaque_in_struct.hpp index 2de2de3e..12910e1f 100644 --- a/tests/headers/opaque_in_struct.hpp +++ b/tests/headers/opaque_in_struct.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq /** <div rustbindgen opaque> */ diff --git a/tests/headers/opaque_pointer.hpp b/tests/headers/opaque_pointer.hpp index 40475b8b..00868985 100644 --- a/tests/headers/opaque_pointer.hpp +++ b/tests/headers/opaque_pointer.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq /** * <div rustbindgen opaque></div> diff --git a/tests/headers/opaque_typedef.hpp b/tests/headers/opaque_typedef.hpp index 80586778..878d5bcb 100644 --- a/tests/headers/opaque_typedef.hpp +++ b/tests/headers/opaque_typedef.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++11 +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11 template<typename T> class RandomTemplate; |