summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gen.rs4
-rw-r--r--tests/expectations/class_with_inner_struct.rs2
-rw-r--r--tests/expectations/enum.rs4
-rw-r--r--tests/expectations/enum_and_vtable_mangling.rs2
-rw-r--r--tests/expectations/enum_dupe.rs2
-rw-r--r--tests/expectations/enum_explicit_type.rs10
-rw-r--r--tests/expectations/enum_negative.rs2
-rw-r--r--tests/expectations/enum_packed.rs6
-rw-r--r--tests/expectations/func_ptr_in_struct.rs2
-rw-r--r--tests/expectations/jsval_layout_opaque.rs8
-rw-r--r--tests/expectations/overflowed_enum.rs4
-rw-r--r--tests/expectations/weird_bitfields.rs2
12 files changed, 24 insertions, 24 deletions
diff --git a/src/gen.rs b/src/gen.rs
index b819c516..47133c43 100644
--- a/src/gen.rs
+++ b/src/gen.rs
@@ -1491,9 +1491,9 @@ fn cenum_to_rs(ctx: &mut GenCtx,
}));
attrs.push(if ctx.options.derive_debug {
- mk_deriving_attr(ctx, &["Debug", "Copy", "Clone"])
+ mk_deriving_attr(ctx, &["Debug", "Copy", "Clone", "Eq", "PartialEq", "Hash"])
} else {
- mk_deriving_attr(ctx, &["Copy", "Clone"])
+ mk_deriving_attr(ctx, &["Copy", "Clone", "Eq", "PartialEq", "Hash"])
});
items.push(P(ast::Item {
diff --git a/tests/expectations/class_with_inner_struct.rs b/tests/expectations/class_with_inner_struct.rs
index 85954397..b8dbf3ac 100644
--- a/tests/expectations/class_with_inner_struct.rs
+++ b/tests/expectations/class_with_inner_struct.rs
@@ -124,7 +124,7 @@ fn bindgen_test_layout_Struct_B() {
assert_eq!(::std::mem::align_of::<Struct_B>() , 4usize);
}
#[repr(i32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_StepSyntax {
Keyword = 0,
FunctionalWithoutKeyword = 1,
diff --git a/tests/expectations/enum.rs b/tests/expectations/enum.rs
index 0b426196..23a599b9 100644
--- a/tests/expectations/enum.rs
+++ b/tests/expectations/enum.rs
@@ -6,8 +6,8 @@
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
diff --git a/tests/expectations/enum_and_vtable_mangling.rs b/tests/expectations/enum_and_vtable_mangling.rs
index 63e66991..f6b1385a 100644
--- a/tests/expectations/enum_and_vtable_mangling.rs
+++ b/tests/expectations/enum_and_vtable_mangling.rs
@@ -6,7 +6,7 @@
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_enum_and_vtable_mangling_hpp_unnamed_1 {
match_ = 0,
whatever_else = 1,
diff --git a/tests/expectations/enum_dupe.rs b/tests/expectations/enum_dupe.rs
index 2d691b69..28d7b63d 100644
--- a/tests/expectations/enum_dupe.rs
+++ b/tests/expectations/enum_dupe.rs
@@ -7,5 +7,5 @@
pub const Dupe: Enum_Foo = Enum_Foo::Bar;
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 1, }
diff --git a/tests/expectations/enum_explicit_type.rs b/tests/expectations/enum_explicit_type.rs
index a5a92d99..cfc1f41d 100644
--- a/tests/expectations/enum_explicit_type.rs
+++ b/tests/expectations/enum_explicit_type.rs
@@ -6,17 +6,17 @@
#[repr(u8)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
#[repr(i64)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_MuchLong { MuchLow = -4294967296, }
#[repr(u64)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_MuchLongLong { MuchHigh = 4294967296, }
diff --git a/tests/expectations/enum_negative.rs b/tests/expectations/enum_negative.rs
index 24b009e9..0a7a36f7 100644
--- a/tests/expectations/enum_negative.rs
+++ b/tests/expectations/enum_negative.rs
@@ -6,5 +6,5 @@
#[repr(i32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = -2, Qux = 1, }
diff --git a/tests/expectations/enum_packed.rs b/tests/expectations/enum_packed.rs
index 12f0bd49..6b3f1b57 100644
--- a/tests/expectations/enum_packed.rs
+++ b/tests/expectations/enum_packed.rs
@@ -6,11 +6,11 @@
#[repr(u8)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo { Bar = 0, Qux = 1, }
#[repr(i8)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Neg { MinusOne = -1, One = 1, }
#[repr(u16)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bigger { Much = 255, Larger = 256, }
diff --git a/tests/expectations/func_ptr_in_struct.rs b/tests/expectations/func_ptr_in_struct.rs
index 970e3122..c177116d 100644
--- a/tests/expectations/func_ptr_in_struct.rs
+++ b/tests/expectations/func_ptr_in_struct.rs
@@ -6,7 +6,7 @@
#[repr(i32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_baz { _BindgenOpaqueEnum = 0, }
#[repr(C)]
#[derive(Debug, Copy)]
diff --git a/tests/expectations/jsval_layout_opaque.rs b/tests/expectations/jsval_layout_opaque.rs
index 33c2ce32..b799a3a4 100644
--- a/tests/expectations/jsval_layout_opaque.rs
+++ b/tests/expectations/jsval_layout_opaque.rs
@@ -25,7 +25,7 @@ impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
}
pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47;
#[repr(u8)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum JSValueType {
JSVAL_TYPE_DOUBLE = 0,
JSVAL_TYPE_INT32 = 1,
@@ -40,7 +40,7 @@ pub enum JSValueType {
JSVAL_TYPE_MISSING = 33,
}
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum JSValueTag {
JSVAL_TAG_MAX_DOUBLE = 131056,
JSVAL_TAG_INT32 = 131057,
@@ -53,7 +53,7 @@ pub enum JSValueTag {
JSVAL_TAG_OBJECT = 131064,
}
#[repr(u64)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_MAX_DOUBLE = 18444492278190833663,
JSVAL_SHIFTED_TAG_INT32 = 18444633011384221696,
@@ -66,7 +66,7 @@ pub enum JSValueShiftedTag {
JSVAL_SHIFTED_TAG_OBJECT = 18445618173802708992,
}
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum JSWhyMagic {
JS_ELEMENTS_HOLE = 0,
JS_NO_ITER_VALUE = 1,
diff --git a/tests/expectations/overflowed_enum.rs b/tests/expectations/overflowed_enum.rs
index e32db0ae..7b6de96b 100644
--- a/tests/expectations/overflowed_enum.rs
+++ b/tests/expectations/overflowed_enum.rs
@@ -6,12 +6,12 @@
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Foo {
BAP_ARM = 9698489,
BAP_X86 = 11960045,
BAP_X86_64 = 3128633167,
}
#[repr(u16)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_Bar { One = 1, Big = 2, }
diff --git a/tests/expectations/weird_bitfields.rs b/tests/expectations/weird_bitfields.rs
index 405c2490..c9b8daa4 100644
--- a/tests/expectations/weird_bitfields.rs
+++ b/tests/expectations/weird_bitfields.rs
@@ -6,7 +6,7 @@
#[repr(u32)]
-#[derive(Debug, Copy, Clone)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Enum_nsStyleSVGOpacitySource {
eStyleSVGOpacitySource_Normal = 0,
eStyleSVGOpacitySource_ContextFillOpacity = 1,