Skip to content

Commit dc2baed

Browse files
author
Zhiting Zhu
committed
Small tests for derive PartialEq
1 parent 238499b commit dc2baed

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/expectations/tests/derive-hash-struct-with-pointer.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
55

66

7-
/// Pointers can derive hash
7+
/// Pointers can derive hash/PartialEq
88
#[repr(C)]
9-
#[derive(Debug, Copy, Hash)]
9+
#[derive(Debug, Copy, Hash, PartialEq)]
1010
pub struct ConstPtrMutObj {
1111
pub bar: *const ::std::os::raw::c_int,
1212
}
@@ -29,7 +29,7 @@ impl Default for ConstPtrMutObj {
2929
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
3030
}
3131
#[repr(C)]
32-
#[derive(Debug, Copy, Hash)]
32+
#[derive(Debug, Copy, Hash, PartialEq)]
3333
pub struct MutPtrMutObj {
3434
pub bar: *mut ::std::os::raw::c_int,
3535
}
@@ -52,7 +52,7 @@ impl Default for MutPtrMutObj {
5252
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
5353
}
5454
#[repr(C)]
55-
#[derive(Debug, Copy, Hash)]
55+
#[derive(Debug, Copy, Hash, PartialEq)]
5656
pub struct MutPtrConstObj {
5757
pub bar: *const ::std::os::raw::c_int,
5858
}
@@ -75,7 +75,7 @@ impl Default for MutPtrConstObj {
7575
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
7676
}
7777
#[repr(C)]
78-
#[derive(Debug, Copy, Hash)]
78+
#[derive(Debug, Copy, Hash, PartialEq)]
7979
pub struct ConstPtrConstObj {
8080
pub bar: *const ::std::os::raw::c_int,
8181
}

tests/headers/derive-hash-struct-with-pointer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// bindgen-flags: --with-derive-hash
1+
// bindgen-flags: --with-derive-hash --with-derive-partialeq
22
//
3-
/// Pointers can derive hash
3+
/// Pointers can derive hash/PartialEq
44
struct ConstPtrMutObj {
55
int* const bar;
66
};

0 commit comments

Comments
 (0)