Skip to content

Commit b87f4ba

Browse files
committed
Template related tests for derive Eq
1 parent 8ed0261 commit b87f4ba

16 files changed

+43
-43
lines changed

tests/expectations/tests/anonymous-template-types.rs

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

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
8+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
99
pub struct Foo<T> {
1010
pub t_member: T,
1111
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -14,12 +14,12 @@ impl <T> Default for Foo<T> {
1414
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1515
}
1616
#[repr(C)]
17-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
17+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
1818
pub struct Bar {
1919
pub member: ::std::os::raw::c_char,
2020
}
2121
#[repr(C)]
22-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
22+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2323
pub struct Quux<V> {
2424
pub v_member: V,
2525
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>,
@@ -28,7 +28,7 @@ impl <V> Default for Quux<V> {
2828
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
2929
}
3030
#[repr(C)]
31-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
31+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
3232
pub struct Lobo {
3333
pub also_member: ::std::os::raw::c_char,
3434
}

tests/expectations/tests/empty_template_param_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
pub type __void_t = ::std::os::raw::c_void;
88
#[repr(C)]
9-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
9+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
1010
pub struct __iterator_traits {
1111
pub _address: u8,
1212
}

tests/expectations/tests/template-fun-ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
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 Foo {
1010
pub _address: u8,
1111
}
1212
pub type Foo_FunctionPtr<T> =
1313
::std::option::Option<unsafe extern "C" fn() -> T>;
1414
#[repr(C)]
15-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
15+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
1616
pub struct RefPtr {
1717
pub _address: u8,
1818
}
1919
#[repr(C)]
20-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
20+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
2121
pub struct RefPtr_Proxy {
2222
pub _address: u8,
2323
}

tests/expectations/tests/template.rs

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

66

77
#[repr(C)]
8-
#[derive(Debug, Hash, PartialEq)]
8+
#[derive(Debug, Hash, PartialEq, Eq)]
99
pub struct Foo<T> {
1010
pub m_member: T,
1111
pub m_member_ptr: *mut T,
@@ -16,7 +16,7 @@ impl <T> Default for Foo<T> {
1616
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1717
}
1818
#[repr(C)]
19-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
19+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2020
pub struct B<T> {
2121
pub m_member: T,
2222
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -34,7 +34,7 @@ pub struct mozilla_Foo {
3434
_unused: [u8; 0],
3535
}
3636
#[repr(C)]
37-
#[derive(Debug, Copy, Hash, PartialEq)]
37+
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
3838
pub struct C {
3939
pub mB: B<::std::os::raw::c_uint>,
4040
pub mBConstPtr: B<*const ::std::os::raw::c_int>,
@@ -140,13 +140,13 @@ impl Default for C {
140140
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
141141
}
142142
#[repr(C)]
143-
#[derive(Debug, Hash, PartialEq)]
143+
#[derive(Debug, Hash, PartialEq, Eq)]
144144
pub struct D {
145145
pub m_foo: D_MyFoo,
146146
}
147147
pub type D_MyFoo = Foo<::std::os::raw::c_int>;
148148
#[repr(C)]
149-
#[derive(Debug, Hash, PartialEq)]
149+
#[derive(Debug, Hash, PartialEq, Eq)]
150150
pub struct D_U<Z> {
151151
pub m_nested_foo: D_MyFoo,
152152
pub m_baz: Z,
@@ -159,7 +159,7 @@ impl Default for D {
159159
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
160160
}
161161
#[repr(C)]
162-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
162+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
163163
pub struct Rooted<T> {
164164
pub prev: *mut T,
165165
pub next: *mut Rooted<*mut ::std::os::raw::c_void>,
@@ -170,7 +170,7 @@ impl <T> Default for Rooted<T> {
170170
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
171171
}
172172
#[repr(C)]
173-
#[derive(Debug, Copy, Hash, PartialEq)]
173+
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
174174
pub struct RootedContainer {
175175
pub root: Rooted<*mut ::std::os::raw::c_void>,
176176
}
@@ -193,7 +193,7 @@ impl Default for RootedContainer {
193193
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
194194
}
195195
#[repr(C)]
196-
#[derive(Debug, Hash, PartialEq)]
196+
#[derive(Debug, Hash, PartialEq, Eq)]
197197
pub struct WithDtor<T> {
198198
pub member: T,
199199
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -203,7 +203,7 @@ impl <T> Default for WithDtor<T> {
203203
}
204204
pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>;
205205
#[repr(C)]
206-
#[derive(Debug, Hash, PartialEq)]
206+
#[derive(Debug, Hash, PartialEq, Eq)]
207207
pub struct PODButContainsDtor {
208208
pub member: WithDtorIntFwd,
209209
}
@@ -224,11 +224,11 @@ impl Default for PODButContainsDtor {
224224
}
225225
/// <div rustbindgen opaque>
226226
#[repr(C)]
227-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
227+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
228228
pub struct Opaque {
229229
}
230230
#[repr(C)]
231-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
231+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
232232
pub struct POD {
233233
pub opaque_member: u32,
234234
}
@@ -249,7 +249,7 @@ impl Clone for POD {
249249
}
250250
/// <div rustbindgen replaces="NestedReplaced"></div>
251251
#[repr(C)]
252-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
252+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
253253
pub struct NestedReplaced<T> {
254254
pub buff: *mut T,
255255
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -258,7 +258,7 @@ impl <T> Default for NestedReplaced<T> {
258258
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
259259
}
260260
#[repr(C)]
261-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
261+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
262262
pub struct NestedBase<T> {
263263
pub buff: *mut T,
264264
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -267,7 +267,7 @@ impl <T> Default for NestedBase<T> {
267267
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
268268
}
269269
#[repr(C)]
270-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
270+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
271271
pub struct Incomplete<T> {
272272
pub d: T,
273273
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -276,7 +276,7 @@ impl <T> Default for Incomplete<T> {
276276
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
277277
}
278278
#[repr(C)]
279-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
279+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
280280
pub struct NestedContainer<T> {
281281
pub c: T,
282282
pub nested: NestedReplaced<T>,
@@ -287,7 +287,7 @@ impl <T> Default for NestedContainer<T> {
287287
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
288288
}
289289
#[repr(C)]
290-
#[derive(Debug, Default, Copy, Hash, PartialEq)]
290+
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
291291
pub struct Untemplated {
292292
pub _address: u8,
293293
}
@@ -302,7 +302,7 @@ impl Clone for Untemplated {
302302
fn clone(&self) -> Self { *self }
303303
}
304304
#[repr(C)]
305-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
305+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
306306
pub struct Templated {
307307
pub m_untemplated: Untemplated,
308308
}
@@ -311,7 +311,7 @@ pub struct Templated {
311311
///
312312
/// <div rustbindgen replaces="ReplacedWithoutDestructor"></div>
313313
#[repr(C)]
314-
#[derive(Debug, Hash, PartialEq)]
314+
#[derive(Debug, Hash, PartialEq, Eq)]
315315
pub struct ReplacedWithoutDestructor<T> {
316316
pub buff: *mut T,
317317
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -320,7 +320,7 @@ impl <T> Default for ReplacedWithoutDestructor<T> {
320320
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
321321
}
322322
#[repr(C)]
323-
#[derive(Debug, Hash, PartialEq)]
323+
#[derive(Debug, Hash, PartialEq, Eq)]
324324
pub struct ShouldNotBeCopiable<T> {
325325
pub m_member: ReplacedWithoutDestructor<T>,
326326
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
@@ -329,7 +329,7 @@ impl <T> Default for ShouldNotBeCopiable<T> {
329329
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
330330
}
331331
#[repr(C)]
332-
#[derive(Debug, Hash, PartialEq)]
332+
#[derive(Debug, Hash, PartialEq, Eq)]
333333
pub struct ShouldNotBeCopiableAsWell<U> {
334334
pub m_member: ReplacedWithoutDestructorFwd<U>,
335335
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
@@ -342,7 +342,7 @@ impl <U> Default for ShouldNotBeCopiableAsWell<U> {
342342
///
343343
/// <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div>
344344
#[repr(C)]
345-
#[derive(Debug, Hash, PartialEq)]
345+
#[derive(Debug, Hash, PartialEq, Eq)]
346346
pub struct ReplacedWithoutDestructorFwd<T> {
347347
pub buff: *mut T,
348348
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,

tests/expectations/tests/template_alias.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
pub type JS_detail_Wrapped<T> = T;
88
#[repr(C)]
9-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
9+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1010
pub struct JS_Rooted<T> {
1111
pub ptr: JS_detail_Wrapped<T>,
1212
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,

tests/expectations/tests/template_alias_namespace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod root {
1717
pub type Wrapped<T> = T;
1818
}
1919
#[repr(C)]
20-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
20+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2121
pub struct Rooted<T> {
2222
pub ptr: root::JS::detail::Wrapped<T>,
2323
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,

tests/expectations/tests/template_typedef_transitive_param.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
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 Wrapper {
1010
pub _address: u8,
1111
}
1212
#[repr(C)]
13-
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
13+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1414
pub struct Wrapper_Wrapped<T> {
1515
pub t: T,
1616
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,

tests/expectations/tests/templateref_opaque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
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 detail_PointerType {
1010
pub _address: u8,
1111
}
1212
pub type detail_PointerType_Type<T> = *mut T;
1313
#[repr(C)]
14-
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)]
14+
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
1515
pub struct UniquePtr {
1616
pub _address: u8,
1717
}

tests/headers/anonymous-template-types.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 -- -std=c++14
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14
22

33
template <typename T, typename>
44
struct Foo {

tests/headers/empty_template_param_name.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
// bindgen-flags: -- -std=c++11
33

44
template<typename...> using __void_t = void;

tests/headers/template-fun-ty.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
class Foo
44
{

tests/headers/template.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 -- -std=c++11
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11
22
//
33
template<typename T, typename U> class Foo {
44
T m_member;

tests/headers/template_alias.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 -- -std=c++14
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14
22

33
namespace JS {
44
namespace detail {

tests/headers/template_alias_namespace.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 --enable-cxx-namespaces -- -std=c++14
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --enable-cxx-namespaces -- -std=c++14
22

33
namespace JS {
44
namespace detail {

tests/headers/template_typedef_transitive_param.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 Wrapper {
44
struct Wrapped {

tests/headers/templateref_opaque.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
namespace detail {
44
template<typename T>

0 commit comments

Comments
 (0)