Skip to content

Commit 59a0a94

Browse files
committed
derive missing common traits
1 parent 2716d61 commit 59a0a94

File tree

9 files changed

+26
-22
lines changed

9 files changed

+26
-22
lines changed

src/clock_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pub type clock_flavor_t = ::libc::c_int;
77
pub type clock_attr_t = *mut ::libc::c_int;
88
pub type clock_res_t = ::libc::c_int;
99

10-
#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
1110
#[repr(C)]
11+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
1212
pub struct mach_timespec {
1313
pub tv_sec: ::libc::c_uint,
1414
pub tv_nsec: clock_res_t,

src/dyld_kernel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use boolean::boolean_t;
44
use mach_types::{fsid_t, fsobj_id_t, uuid_t};
55

66
#[repr(C)]
7-
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)]
7+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
88
pub struct dyld_kernel_image_info {
99
pub uuid: uuid_t,
1010
pub fsobjid: fsobj_id_t,
@@ -14,7 +14,7 @@ pub struct dyld_kernel_image_info {
1414

1515
#[allow(non_snake_case)]
1616
#[repr(C)]
17-
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)]
17+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
1818
pub struct dyld_kernel_process_info {
1919
pub cache_image_info: dyld_kernel_image_info,
2020
pub timestamp: u64,

src/mach_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ pub type uuid_t = [::libc::c_uchar; 16];
9090

9191
// <sys/_types/_fsid_t.h>
9292
#[repr(C)]
93-
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)]
93+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
9494
pub struct fsid {
9595
pub val: [i32; 2],
9696
}
9797
pub type fsid_t = fsid;
9898

9999
// <sys/_types/_fsobj_id_t.h>
100100
#[repr(C)]
101-
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, PartialEq)]
101+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
102102
pub struct fsobj_id {
103103
pub fid_objno: u32,
104104
pub fid_generation: u32,

src/message.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub const MACH_RCV_INVALID_TRAILER: mach_msg_return_t = 0x1000_400f;
131131
pub const MACH_RCV_IN_PROGRESS_TIMED: mach_msg_return_t = 0x1000_4011;
132132

133133
#[repr(C)]
134-
#[derive(Copy, Clone, Debug)]
134+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
135135
pub struct mach_msg_header_t {
136136
pub msgh_bits: mach_msg_bits_t,
137137
pub msgh_size: mach_msg_size_t,
@@ -142,13 +142,13 @@ pub struct mach_msg_header_t {
142142
}
143143

144144
#[repr(C)]
145-
#[derive(Copy, Clone, Debug)]
145+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
146146
pub struct mach_msg_body_t {
147147
pub msgh_descriptor_count: mach_msg_size_t,
148148
}
149149

150150
#[repr(C)]
151-
#[derive(Copy, Clone, Debug)]
151+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
152152
pub struct mach_msg_base_t {
153153
pub header: mach_msg_header_t,
154154
pub body: mach_msg_body_t,
@@ -157,14 +157,14 @@ pub struct mach_msg_base_t {
157157
pub const MACH_MSG_TRAILER_FORMAT_0: mach_msg_trailer_type_t = 0;
158158

159159
#[repr(C)]
160-
#[derive(Copy, Clone, Debug)]
160+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
161161
pub struct mach_msg_trailer_t {
162162
pub msgh_trailer_type: mach_msg_trailer_type_t,
163163
pub msgh_trailer_size: mach_msg_trailer_size_t,
164164
}
165165

166166
#[repr(C)]
167-
#[derive(Copy, Clone, Debug)]
167+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
168168
pub struct mach_msg_port_descriptor_t {
169169
pub name: mach_port_t,
170170
pub pad1: mach_msg_size_t,
@@ -186,7 +186,7 @@ impl mach_msg_port_descriptor_t {
186186
}
187187

188188
#[repr(C)]
189-
#[derive(Copy, Clone, Debug)]
189+
#[derive(Copy, Clone, Debug, Hash, PartialOrd, PartialEq, Eq, Ord)]
190190
pub struct mach_msg_ool_descriptor_t {
191191
pub address: *mut ::libc::c_void,
192192
#[cfg(not(target_pointer_width = "64"))]
@@ -218,7 +218,7 @@ impl mach_msg_ool_descriptor_t {
218218
}
219219

220220
#[repr(C)]
221-
#[derive(Copy, Clone, Debug)]
221+
#[derive(Copy, Clone, Debug, Hash, PartialOrd, PartialEq, Eq, Ord)]
222222
pub struct mach_msg_ool_ports_descriptor_t {
223223
pub address: *mut ::libc::c_void,
224224
#[cfg(not(target_pointer_width = "64"))]

src/port.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use vm_types::natural_t;
55
pub type mach_port_name_t = natural_t;
66

77
#[repr(C)]
8+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
89
pub struct ipc_port;
910

1011
pub type ipc_port_t = *mut ipc_port;

src/structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem;
55
use message::mach_msg_type_number_t;
66

77
#[repr(C)]
8-
#[derive(Clone, Debug, Default)]
8+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
99
pub struct x86_thread_state64_t {
1010
pub __rax: u64,
1111
pub __rbx: u64,

src/task_info.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub type task_info_t = *mut integer_t;
4343
note = "requires the unstable feature to avoid undefined behavior"
4444
)
4545
)]
46+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
4647
pub struct task_dyld_info {
4748
pub all_image_info_addr: mach_vm_address_t,
4849
pub all_image_info_size: mach_vm_size_t,

src/vm_region.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub const SM_SHARED_ALIASED: ::libc::c_uchar = 7;
6565
note = "requires the unstable feature to avoid undefined behavior"
6666
)
6767
)]
68-
#[derive(Copy, Clone, Debug)]
68+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
6969
pub struct vm_region_basic_info_64 {
7070
pub protection: vm_prot_t,
7171
pub max_protection: vm_prot_t,
@@ -84,7 +84,7 @@ impl vm_region_basic_info_64 {
8484
}
8585

8686
#[repr(C)]
87-
#[derive(Copy, Clone, Debug)]
87+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
8888
pub struct vm_region_basic_info {
8989
pub protection: vm_prot_t,
9090
pub max_protection: vm_prot_t,
@@ -103,7 +103,7 @@ impl vm_region_basic_info {
103103
}
104104

105105
#[repr(C)]
106-
#[derive(Copy, Clone, Debug)]
106+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
107107
pub struct vm_region_extended_info {
108108
pub protection: vm_prot_t,
109109
pub user_tag: ::libc::c_uint,
@@ -125,7 +125,7 @@ impl vm_region_extended_info {
125125
}
126126

127127
#[repr(C)]
128-
#[derive(Copy, Clone, Debug)]
128+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
129129
pub struct vm_region_top_info {
130130
pub obj_id: ::libc::c_uint,
131131
pub ref_count: ::libc::c_uint,
@@ -141,7 +141,7 @@ impl vm_region_top_info {
141141
}
142142

143143
#[repr(C)]
144-
#[derive(Copy, Clone, Debug)]
144+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
145145
pub struct vm_region_submap_info {
146146
pub protection: vm_prot_t,
147147
pub max_protection: vm_prot_t,
@@ -177,7 +177,7 @@ impl vm_region_submap_info {
177177
note = "requires the `unstable` feature to avoid undefined behavior"
178178
)
179179
)]
180-
#[derive(Copy, Clone, Debug)]
180+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
181181
pub struct vm_region_submap_info_64 {
182182
pub protection: vm_prot_t,
183183
pub max_protection: vm_prot_t,
@@ -214,7 +214,7 @@ impl vm_region_submap_info_64 {
214214
note = "requires the `unstable` feature to avoid undefined behavior"
215215
)
216216
)]
217-
#[derive(Copy, Clone, Debug)]
217+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
218218
pub struct vm_region_submap_short_info_64 {
219219
pub protection: vm_prot_t,
220220
pub max_protection: vm_prot_t,
@@ -238,7 +238,7 @@ impl vm_region_submap_short_info_64 {
238238
}
239239

240240
#[repr(C)]
241-
#[derive(Copy, Clone, Debug)]
241+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
242242
pub struct vm_page_info_basic {
243243
pub disposition: ::libc::c_int,
244244
pub ref_count: ::libc::c_int,
@@ -263,7 +263,7 @@ impl vm_page_info_basic {
263263
note = "requires the `unstable` feature to avoid undefined behavior"
264264
)
265265
)]
266-
#[derive(Copy, Clone, Debug)]
266+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
267267
pub struct mach_vm_read_entry {
268268
pub address: mach_vm_address_t,
269269
pub size: mach_vm_size_t,

src/vm_statistics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub const VM_FLAGS_ANYWHERE: ::libc::c_int = 0x1;
4545
pub const VM_FLAGS_OVERWRITE: ::libc::c_int = 0x4000;
4646

4747
#[repr(C)]
48+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
4849
pub struct vm_statistics {
4950
pub free_count: natural_t,
5051
pub active_count: natural_t,
@@ -69,6 +70,7 @@ pub struct vm_statistics {
6970
note = "`pmap_statistics` was removed after MacOSX 10.3.9"
7071
)]
7172
#[repr(C)]
73+
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
7274
pub struct pmap_statistics {
7375
pub resident_count: integer_t,
7476
pub wired_count: integer_t,

0 commit comments

Comments
 (0)