Skip to content

Commit 8ed0261

Browse files
committed
Anonymous related tests for derive Eq
1 parent 096bc87 commit 8ed0261

11 files changed

+21
-19
lines changed

tests/expectations/tests/anon_enum_trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
8+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
99
pub struct DataType {
1010
pub _address: u8,
1111
}
@@ -27,7 +27,7 @@ pub const DataType_type_: DataType__bindgen_ty_1 =
2727
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2828
pub enum DataType__bindgen_ty_1 { generic_type = 0, }
2929
#[repr(C)]
30-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
30+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
3131
pub struct Foo {
3232
pub _address: u8,
3333
}

tests/expectations/tests/anon_struct_in_union.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub union s__bindgen_ty_1 {
1616
_bindgen_union_align: u32,
1717
}
1818
#[repr(C)]
19-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
19+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
2020
pub struct s__bindgen_ty_1_inner {
2121
pub b: ::std::os::raw::c_int,
2222
}

tests/expectations/tests/anon_struct_in_union_1_0.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,20 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
3434
impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
3535
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true }
3636
}
37+
impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { }
3738
#[repr(C)]
38-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
39+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
3940
pub struct s {
4041
pub u: s__bindgen_ty_1,
4142
}
4243
#[repr(C)]
43-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
44+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
4445
pub struct s__bindgen_ty_1 {
4546
pub field: __BindgenUnionField<s__bindgen_ty_1_inner>,
4647
pub bindgen_union_field: u32,
4748
}
4849
#[repr(C)]
49-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
50+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
5051
pub struct s__bindgen_ty_1_inner {
5152
pub b: ::std::os::raw::c_int,
5253
}

tests/expectations/tests/anon_union.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState =
1717
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1818
pub enum TErrorResult_UnionState { HasMessage = 0, }
1919
#[repr(C)]
20-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
20+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
2121
pub struct TErrorResult_Message {
2222
pub _address: u8,
2323
}
2424
#[repr(C)]
25-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
25+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
2626
pub struct TErrorResult_DOMExceptionInfo {
2727
pub _address: u8,
2828
}

tests/expectations/tests/anon_union_1_0.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
3434
impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
3535
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true }
3636
}
37+
impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { }
3738
#[repr(C)]
38-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
39+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3940
pub struct TErrorResult {
4041
pub mResult: ::std::os::raw::c_int,
4142
pub __bindgen_anon_1: TErrorResult__bindgen_ty_1,
@@ -48,17 +49,17 @@ pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState =
4849
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4950
pub enum TErrorResult_UnionState { HasMessage = 0, }
5051
#[repr(C)]
51-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
52+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
5253
pub struct TErrorResult_Message {
5354
pub _address: u8,
5455
}
5556
#[repr(C)]
56-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
57+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
5758
pub struct TErrorResult_DOMExceptionInfo {
5859
pub _address: u8,
5960
}
6061
#[repr(C)]
61-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
62+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
6263
pub struct TErrorResult__bindgen_ty_1 {
6364
pub mMessage: __BindgenUnionField<*mut TErrorResult_Message>,
6465
pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo>,
@@ -68,7 +69,7 @@ impl Default for TErrorResult {
6869
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
6970
}
7071
#[repr(C)]
71-
#[derive(Debug, Copy, Hash, PartialEq)]
72+
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
7273
pub struct ErrorResult {
7374
pub _base: TErrorResult,
7475
}

tests/headers/anon_enum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
22
struct Test {
33
int foo;
44
float bar;

tests/headers/anon_enum_trait.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
22

33
template<typename _Tp>
44
class DataType {

tests/headers/anon_struct_in_union.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
22
struct s {
33
union {
44
struct inner {

tests/headers/anon_struct_in_union_1_0.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq
22

33
struct s {
44
union {

tests/headers/anon_union.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq
22
template<typename T>
33
struct TErrorResult {
44
enum UnionState {

tests/headers/anon_union_1_0.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq
1+
// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq
22

33
template<typename T>
44
struct TErrorResult {

0 commit comments

Comments
 (0)