diff options
author | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-16 21:17:21 -0500 |
---|---|---|
committer | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-21 16:14:41 -0500 |
commit | b87f4ba8ba8851cc9f8cbd06cbaf348c689aa402 (patch) | |
tree | f70160a0fd22c5558191a7b76ee307467fccda63 | |
parent | 8ed02618a57ead804c58b263f66dd8047c4bc9c6 (diff) |
Template related tests for derive Eq
-rw-r--r-- | tests/expectations/tests/anonymous-template-types.rs | 8 | ||||
-rw-r--r-- | tests/expectations/tests/empty_template_param_name.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/template-fun-ty.rs | 6 | ||||
-rw-r--r-- | tests/expectations/tests/template.rs | 42 | ||||
-rw-r--r-- | tests/expectations/tests/template_alias.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/template_alias_namespace.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/template_typedef_transitive_param.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/templateref_opaque.rs | 4 | ||||
-rw-r--r-- | tests/headers/anonymous-template-types.hpp | 2 | ||||
-rw-r--r-- | tests/headers/empty_template_param_name.hpp | 2 | ||||
-rw-r--r-- | tests/headers/template-fun-ty.hpp | 2 | ||||
-rw-r--r-- | tests/headers/template.hpp | 2 | ||||
-rw-r--r-- | tests/headers/template_alias.hpp | 2 | ||||
-rw-r--r-- | tests/headers/template_alias_namespace.hpp | 2 | ||||
-rw-r--r-- | tests/headers/template_typedef_transitive_param.hpp | 2 | ||||
-rw-r--r-- | tests/headers/templateref_opaque.hpp | 2 |
16 files changed, 43 insertions, 43 deletions
diff --git a/tests/expectations/tests/anonymous-template-types.rs b/tests/expectations/tests/anonymous-template-types.rs index cc682751..532e2427 100644 --- a/tests/expectations/tests/anonymous-template-types.rs +++ b/tests/expectations/tests/anonymous-template-types.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Foo<T> { pub t_member: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -14,12 +14,12 @@ impl <T> Default for Foo<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Bar { pub member: ::std::os::raw::c_char, } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Quux<V> { pub v_member: V, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<V>>, @@ -28,7 +28,7 @@ impl <V> Default for Quux<V> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Lobo { pub also_member: ::std::os::raw::c_char, } diff --git a/tests/expectations/tests/empty_template_param_name.rs b/tests/expectations/tests/empty_template_param_name.rs index aff9d14d..30289ce4 100644 --- a/tests/expectations/tests/empty_template_param_name.rs +++ b/tests/expectations/tests/empty_template_param_name.rs @@ -6,7 +6,7 @@ pub type __void_t = ::std::os::raw::c_void; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct __iterator_traits { pub _address: u8, } diff --git a/tests/expectations/tests/template-fun-ty.rs b/tests/expectations/tests/template-fun-ty.rs index 1cecdada..8403f794 100644 --- a/tests/expectations/tests/template-fun-ty.rs +++ b/tests/expectations/tests/template-fun-ty.rs @@ -5,19 +5,19 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Foo { pub _address: u8, } pub type Foo_FunctionPtr<T> = ::std::option::Option<unsafe extern "C" fn() -> T>; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct RefPtr { pub _address: u8, } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct RefPtr_Proxy { pub _address: u8, } diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs index ff18874d..91bdee72 100644 --- a/tests/expectations/tests/template.rs +++ b/tests/expectations/tests/template.rs @@ -5,7 +5,7 @@ #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct Foo<T> { pub m_member: T, pub m_member_ptr: *mut T, @@ -16,7 +16,7 @@ impl <T> Default for Foo<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct B<T> { pub m_member: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -34,7 +34,7 @@ pub struct mozilla_Foo { _unused: [u8; 0], } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct C { pub mB: B<::std::os::raw::c_uint>, pub mBConstPtr: B<*const ::std::os::raw::c_int>, @@ -140,13 +140,13 @@ impl Default for C { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct D { pub m_foo: D_MyFoo, } pub type D_MyFoo = Foo<::std::os::raw::c_int>; #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct D_U<Z> { pub m_nested_foo: D_MyFoo, pub m_baz: Z, @@ -159,7 +159,7 @@ impl Default for D { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Rooted<T> { pub prev: *mut T, pub next: *mut Rooted<*mut ::std::os::raw::c_void>, @@ -170,7 +170,7 @@ impl <T> Default for Rooted<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct RootedContainer { pub root: Rooted<*mut ::std::os::raw::c_void>, } @@ -193,7 +193,7 @@ impl Default for RootedContainer { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct WithDtor<T> { pub member: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -203,7 +203,7 @@ impl <T> Default for WithDtor<T> { } pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>; #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct PODButContainsDtor { pub member: WithDtorIntFwd, } @@ -224,11 +224,11 @@ impl Default for PODButContainsDtor { } /// <div rustbindgen opaque> #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Opaque { } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct POD { pub opaque_member: u32, } @@ -249,7 +249,7 @@ impl Clone for POD { } /// <div rustbindgen replaces="NestedReplaced"></div> #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct NestedReplaced<T> { pub buff: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -258,7 +258,7 @@ impl <T> Default for NestedReplaced<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct NestedBase<T> { pub buff: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -267,7 +267,7 @@ impl <T> Default for NestedBase<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Incomplete<T> { pub d: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -276,7 +276,7 @@ impl <T> Default for Incomplete<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct NestedContainer<T> { pub c: T, pub nested: NestedReplaced<T>, @@ -287,7 +287,7 @@ impl <T> Default for NestedContainer<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct Untemplated { pub _address: u8, } @@ -302,7 +302,7 @@ impl Clone for Untemplated { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Templated { pub m_untemplated: Untemplated, } @@ -311,7 +311,7 @@ pub struct Templated { /// /// <div rustbindgen replaces="ReplacedWithoutDestructor"></div> #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct ReplacedWithoutDestructor<T> { pub buff: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -320,7 +320,7 @@ impl <T> Default for ReplacedWithoutDestructor<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct ShouldNotBeCopiable<T> { pub m_member: ReplacedWithoutDestructor<T>, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, @@ -329,7 +329,7 @@ impl <T> Default for ShouldNotBeCopiable<T> { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct ShouldNotBeCopiableAsWell<U> { pub m_member: ReplacedWithoutDestructorFwd<U>, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>, @@ -342,7 +342,7 @@ impl <U> Default for ShouldNotBeCopiableAsWell<U> { /// /// <div rustbindgen replaces="ReplacedWithoutDestructorFwd"></div> #[repr(C)] -#[derive(Debug, Hash, PartialEq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub struct ReplacedWithoutDestructorFwd<T> { pub buff: *mut T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs index 1857e714..c3f080db 100644 --- a/tests/expectations/tests/template_alias.rs +++ b/tests/expectations/tests/template_alias.rs @@ -6,7 +6,7 @@ pub type JS_detail_Wrapped<T> = T; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct JS_Rooted<T> { pub ptr: JS_detail_Wrapped<T>, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, diff --git a/tests/expectations/tests/template_alias_namespace.rs b/tests/expectations/tests/template_alias_namespace.rs index 46db54dd..a9cd315d 100644 --- a/tests/expectations/tests/template_alias_namespace.rs +++ b/tests/expectations/tests/template_alias_namespace.rs @@ -17,7 +17,7 @@ pub mod root { pub type Wrapped<T> = T; } #[repr(C)] - #[derive(Debug, Copy, Clone, Hash, PartialEq)] + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Rooted<T> { pub ptr: root::JS::detail::Wrapped<T>, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/tests/expectations/tests/template_typedef_transitive_param.rs index d3114413..7768d522 100644 --- a/tests/expectations/tests/template_typedef_transitive_param.rs +++ b/tests/expectations/tests/template_typedef_transitive_param.rs @@ -5,12 +5,12 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Wrapper { pub _address: u8, } #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Wrapper_Wrapped<T> { pub t: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, diff --git a/tests/expectations/tests/templateref_opaque.rs b/tests/expectations/tests/templateref_opaque.rs index 3f119382..481a31bb 100644 --- a/tests/expectations/tests/templateref_opaque.rs +++ b/tests/expectations/tests/templateref_opaque.rs @@ -5,13 +5,13 @@ #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct detail_PointerType { pub _address: u8, } pub type detail_PointerType_Type<T> = *mut T; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct UniquePtr { pub _address: u8, } diff --git a/tests/headers/anonymous-template-types.hpp b/tests/headers/anonymous-template-types.hpp index 883f60f5..d4ad534b 100644 --- a/tests/headers/anonymous-template-types.hpp +++ b/tests/headers/anonymous-template-types.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++14 +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14 template <typename T, typename> struct Foo { diff --git a/tests/headers/empty_template_param_name.hpp b/tests/headers/empty_template_param_name.hpp index 11b6221c..ab2aab92 100644 --- a/tests/headers/empty_template_param_name.hpp +++ b/tests/headers/empty_template_param_name.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 template<typename...> using __void_t = void; diff --git a/tests/headers/template-fun-ty.hpp b/tests/headers/template-fun-ty.hpp index ea820e2a..bb9d23cf 100644 --- a/tests/headers/template-fun-ty.hpp +++ b/tests/headers/template-fun-ty.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq template <typename T> class Foo { diff --git a/tests/headers/template.hpp b/tests/headers/template.hpp index b7566c71..eea2c4de 100644 --- a/tests/headers/template.hpp +++ b/tests/headers/template.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, typename U> class Foo { T m_member; diff --git a/tests/headers/template_alias.hpp b/tests/headers/template_alias.hpp index 1877db5c..8b3ea692 100644 --- a/tests/headers/template_alias.hpp +++ b/tests/headers/template_alias.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq -- -std=c++14 +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++14 namespace JS { namespace detail { diff --git a/tests/headers/template_alias_namespace.hpp b/tests/headers/template_alias_namespace.hpp index fafa6f27..c20bf206 100644 --- a/tests/headers/template_alias_namespace.hpp +++ b/tests/headers/template_alias_namespace.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq --enable-cxx-namespaces -- -std=c++14 +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq --enable-cxx-namespaces -- -std=c++14 namespace JS { namespace detail { diff --git a/tests/headers/template_typedef_transitive_param.hpp b/tests/headers/template_typedef_transitive_param.hpp index 0f657c1e..34a5b92c 100644 --- a/tests/headers/template_typedef_transitive_param.hpp +++ b/tests/headers/template_typedef_transitive_param.hpp @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq template<typename T> struct Wrapper { struct Wrapped { diff --git a/tests/headers/templateref_opaque.hpp b/tests/headers/templateref_opaque.hpp index e52f7e82..2f6a0027 100644 --- a/tests/headers/templateref_opaque.hpp +++ b/tests/headers/templateref_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 namespace detail { template<typename T> |