summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/expectations/tests/issue-648-derive-debug-with-padding.rs4
-rw-r--r--tests/expectations/tests/layout_array.rs6
-rw-r--r--tests/expectations/tests/layout_array_too_long.rs8
-rw-r--r--tests/expectations/tests/layout_eth_conf.rs34
-rw-r--r--tests/expectations/tests/layout_eth_conf_1_0.rs39
-rw-r--r--tests/expectations/tests/layout_mbuf.rs12
-rw-r--r--tests/expectations/tests/layout_mbuf_1_0.rs29
-rw-r--r--tests/headers/issue-648-derive-debug-with-padding.h6
-rw-r--r--tests/headers/layout_array.h2
-rw-r--r--tests/headers/layout_array_too_long.h2
-rw-r--r--tests/headers/layout_eth_conf.h3
-rw-r--r--tests/headers/layout_eth_conf_1_0.h2
-rw-r--r--tests/headers/layout_mbuf.h2
-rw-r--r--tests/headers/layout_mbuf_1_0.h2
14 files changed, 78 insertions, 73 deletions
diff --git a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
index 0e22eedf..b77b0e60 100644
--- a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
+++ b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
@@ -30,8 +30,8 @@ impl Clone for NoDebug {
impl Default for NoDebug {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
-/// This should derive Debug/Hash because the padding size is less than the max derive
-/// Debug/Hash impl for arrays. However, we conservatively don't derive Debug/Hash because
+/// This should derive Debug/Hash/PartialEq because the padding size is less than the max derive
+/// Debug/Hash/PartialEq impl for arrays. However, we conservatively don't derive Debug/Hash because
/// we determine Debug derive-ability before we compute padding, which happens at
/// codegen. (Again, we expect to get the alignment wrong for similar reasons.)
#[repr(C)]
diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs
index 8ec289d4..081000bd 100644
--- a/tests/expectations/tests/layout_array.rs
+++ b/tests/expectations/tests/layout_array.rs
@@ -106,7 +106,7 @@ impl Default for rte_mempool_ops {
}
/// The rte_spinlock_t type.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_spinlock_t {
/// < lock status 0 = unlocked, 1 = locked
pub locked: ::std::os::raw::c_int,
@@ -181,7 +181,7 @@ pub struct malloc_heap {
pub total_size: usize,
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct malloc_heap__bindgen_ty_1 {
pub lh_first: *mut malloc_elem,
}
@@ -239,7 +239,7 @@ impl Default for malloc_heap {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct malloc_elem {
pub _address: u8,
}
diff --git a/tests/expectations/tests/layout_array_too_long.rs b/tests/expectations/tests/layout_array_too_long.rs
index 6078e2cc..b68d9a33 100644
--- a/tests/expectations/tests/layout_array_too_long.rs
+++ b/tests/expectations/tests/layout_array_too_long.rs
@@ -20,7 +20,7 @@ pub enum _bindgen_ty_1 {
}
/// @internal fragmented mbuf
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ip_frag {
/// < offset into the packet
pub ofs: u16,
@@ -59,7 +59,7 @@ impl Default for ip_frag {
}
/// @internal <src addr, dst_addr, id> to uniquely indetify fragmented datagram.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct ip_frag_key {
/// < src address, first 8 bytes used for IPv4
pub src_dst: [u64; 4usize],
@@ -115,7 +115,7 @@ pub struct ip_frag_pkt {
pub __bindgen_padding_0: [u64; 6usize],
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct ip_frag_pkt__bindgen_ty_1 {
pub tqe_next: *mut ip_frag_pkt,
pub tqe_prev: *mut *mut ip_frag_pkt,
@@ -196,7 +196,7 @@ impl Default for ip_frag_pkt {
}
/// < fragment mbuf
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf {
pub _address: u8,
}
diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs
index 962cc52f..1926ae7c 100644
--- a/tests/expectations/tests/layout_eth_conf.rs
+++ b/tests/expectations/tests/layout_eth_conf.rs
@@ -52,7 +52,7 @@ pub enum rte_eth_rx_mq_mode {
}
/// A structure used to configure the RX features of an Ethernet port.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_rxmode {
/// The multi-queue packet distribution mode to be used, e.g. RSS.
pub mq_mode: rte_eth_rx_mq_mode,
@@ -470,7 +470,7 @@ pub enum rte_eth_tx_mq_mode {
}
/// A structure used to configure the TX features of an Ethernet port.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_txmode {
/// < TX multi-queues mode.
pub mq_mode: rte_eth_tx_mq_mode,
@@ -641,7 +641,7 @@ impl rte_eth_txmode {
/// types of IPv4/IPv6 packets to which the RSS hashing must be applied.
/// Supplying an *rss_hf* equal to zero disables the RSS feature.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_rss_conf {
/// < If not NULL, 40-byte hash key.
pub rss_key: *mut u8,
@@ -718,7 +718,7 @@ pub struct rte_eth_vmdq_dcb_conf {
pub dcb_tc: [u8; 8usize],
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
/// < The vlan id of the received frame
pub vlan_id: u16,
@@ -798,7 +798,7 @@ impl Default for rte_eth_vmdq_dcb_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_dcb_rx_conf {
/// < Possible DCB TCs, 4 or 8 TCs
pub nb_tcs: rte_eth_nb_tcs,
@@ -830,7 +830,7 @@ impl Default for rte_eth_dcb_rx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_dcb_tx_conf {
/// < With DCB, 16 or 32 pools.
pub nb_queue_pools: rte_eth_nb_pools,
@@ -864,7 +864,7 @@ impl Default for rte_eth_vmdq_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_dcb_tx_conf {
/// < Possible DCB TCs, 4 or 8 TCs.
pub nb_tcs: rte_eth_nb_tcs,
@@ -896,7 +896,7 @@ impl Default for rte_eth_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_tx_conf {
/// < VMDq mode, 64 pools.
pub nb_queue_pools: rte_eth_nb_pools,
@@ -939,7 +939,7 @@ pub struct rte_eth_vmdq_rx_conf {
pub pool_map: [rte_eth_vmdq_rx_conf__bindgen_ty_1; 64usize],
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
/// < The vlan id of the received frame
pub vlan_id: u16,
@@ -1052,7 +1052,7 @@ pub enum rte_fdir_status_mode {
}
/// A structure used to define the input for IPV4 flow
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_ipv4_flow {
/// < IPv4 source address in big endian.
pub src_ip: u32,
@@ -1102,7 +1102,7 @@ impl Clone for rte_eth_ipv4_flow {
}
/// A structure used to define the input for IPV6 flow
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_ipv6_flow {
/// < IPv6 source address in big endian.
pub src_ip: [u32; 4usize],
@@ -1153,7 +1153,7 @@ impl Clone for rte_eth_ipv6_flow {
/// A structure used to configure FDIR masks that are used by the device
/// to match the various fields of RX packet headers.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_masks {
/// < Bit mask for vlan_tci in big endian
pub vlan_tci_mask: u16,
@@ -1239,7 +1239,7 @@ pub enum rte_eth_payload_type {
/// A structure used to select bytes extracted from the protocol layers to
/// flexible payload for filter
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_flex_payload_cfg {
/// < Payload type
pub type_: rte_eth_payload_type,
@@ -1274,7 +1274,7 @@ impl Default for rte_eth_flex_payload_cfg {
/// A structure used to define FDIR masks for flexible payload
/// for each flow type
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_flex_mask {
pub flow_type: u16,
pub mask: [u8; 16usize],
@@ -1304,7 +1304,7 @@ impl Clone for rte_eth_fdir_flex_mask {
/// A structure used to define all flexible payload related setting
/// include flex payload and flex mask
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_flex_conf {
/// < The number of following payload cfg
pub nb_payloads: u16,
@@ -1353,7 +1353,7 @@ impl Default for rte_eth_fdir_flex_conf {
///
/// If mode is RTE_FDIR_DISABLE, the pballoc value is ignored.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_fdir_conf {
/// < Flow Director mode.
pub mode: rte_fdir_mode,
@@ -1411,7 +1411,7 @@ impl Default for rte_fdir_conf {
}
/// A structure used to enable/disable specific device interrupts.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_intr_conf {
/// enable/disable lsc interrupt. 0 (default) - disable, 1 enable
pub lsc: u16,
diff --git a/tests/expectations/tests/layout_eth_conf_1_0.rs b/tests/expectations/tests/layout_eth_conf_1_0.rs
index 6cf37ac5..b845321e 100644
--- a/tests/expectations/tests/layout_eth_conf_1_0.rs
+++ b/tests/expectations/tests/layout_eth_conf_1_0.rs
@@ -31,6 +31,9 @@ impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
}
+impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
+ fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true }
+}
pub const ETH_MQ_RX_RSS_FLAG: ::std::os::raw::c_uint = 1;
pub const ETH_MQ_RX_DCB_FLAG: ::std::os::raw::c_uint = 2;
pub const ETH_MQ_RX_VMDQ_FLAG: ::std::os::raw::c_uint = 4;
@@ -79,7 +82,7 @@ pub enum rte_eth_rx_mq_mode {
}
/// A structure used to configure the RX features of an Ethernet port.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_rxmode {
/// The multi-queue packet distribution mode to be used, e.g. RSS.
pub mq_mode: rte_eth_rx_mq_mode,
@@ -497,7 +500,7 @@ pub enum rte_eth_tx_mq_mode {
}
/// A structure used to configure the TX features of an Ethernet port.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_txmode {
/// < TX multi-queues mode.
pub mq_mode: rte_eth_tx_mq_mode,
@@ -668,7 +671,7 @@ impl rte_eth_txmode {
/// types of IPv4/IPv6 packets to which the RSS hashing must be applied.
/// Supplying an *rss_hf* equal to zero disables the RSS feature.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_rss_conf {
/// < If not NULL, 40-byte hash key.
pub rss_key: *mut u8,
@@ -745,7 +748,7 @@ pub struct rte_eth_vmdq_dcb_conf {
pub dcb_tc: [u8; 8usize],
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
/// < The vlan id of the received frame
pub vlan_id: u16,
@@ -825,7 +828,7 @@ impl Default for rte_eth_vmdq_dcb_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_dcb_rx_conf {
/// < Possible DCB TCs, 4 or 8 TCs
pub nb_tcs: rte_eth_nb_tcs,
@@ -857,7 +860,7 @@ impl Default for rte_eth_dcb_rx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_dcb_tx_conf {
/// < With DCB, 16 or 32 pools.
pub nb_queue_pools: rte_eth_nb_pools,
@@ -891,7 +894,7 @@ impl Default for rte_eth_vmdq_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_dcb_tx_conf {
/// < Possible DCB TCs, 4 or 8 TCs.
pub nb_tcs: rte_eth_nb_tcs,
@@ -923,7 +926,7 @@ impl Default for rte_eth_dcb_tx_conf {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_tx_conf {
/// < VMDq mode, 64 pools.
pub nb_queue_pools: rte_eth_nb_pools,
@@ -966,7 +969,7 @@ pub struct rte_eth_vmdq_rx_conf {
pub pool_map: [rte_eth_vmdq_rx_conf__bindgen_ty_1; 64usize],
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
/// < The vlan id of the received frame
pub vlan_id: u16,
@@ -1079,7 +1082,7 @@ pub enum rte_fdir_status_mode {
}
/// A structure used to define the input for IPV4 flow
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_ipv4_flow {
/// < IPv4 source address in big endian.
pub src_ip: u32,
@@ -1129,7 +1132,7 @@ impl Clone for rte_eth_ipv4_flow {
}
/// A structure used to define the input for IPV6 flow
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_ipv6_flow {
/// < IPv6 source address in big endian.
pub src_ip: [u32; 4usize],
@@ -1180,7 +1183,7 @@ impl Clone for rte_eth_ipv6_flow {
/// A structure used to configure FDIR masks that are used by the device
/// to match the various fields of RX packet headers.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_masks {
/// < Bit mask for vlan_tci in big endian
pub vlan_tci_mask: u16,
@@ -1266,7 +1269,7 @@ pub enum rte_eth_payload_type {
/// A structure used to select bytes extracted from the protocol layers to
/// flexible payload for filter
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_flex_payload_cfg {
/// < Payload type
pub type_: rte_eth_payload_type,
@@ -1301,7 +1304,7 @@ impl Default for rte_eth_flex_payload_cfg {
/// A structure used to define FDIR masks for flexible payload
/// for each flow type
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_flex_mask {
pub flow_type: u16,
pub mask: [u8; 16usize],
@@ -1331,7 +1334,7 @@ impl Clone for rte_eth_fdir_flex_mask {
/// A structure used to define all flexible payload related setting
/// include flex payload and flex mask
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_eth_fdir_flex_conf {
/// < The number of following payload cfg
pub nb_payloads: u16,
@@ -1380,7 +1383,7 @@ impl Default for rte_eth_fdir_flex_conf {
///
/// If mode is RTE_FDIR_DISABLE, the pballoc value is ignored.
#[repr(C)]
-#[derive(Debug, Copy, Hash)]
+#[derive(Debug, Copy, Hash, PartialEq)]
pub struct rte_fdir_conf {
/// < Flow Director mode.
pub mode: rte_fdir_mode,
@@ -1438,7 +1441,7 @@ impl Default for rte_fdir_conf {
}
/// A structure used to enable/disable specific device interrupts.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_intr_conf {
/// enable/disable lsc interrupt. 0 (default) - disable, 1 enable
pub lsc: u16,
@@ -1551,7 +1554,7 @@ impl Default for rte_eth_conf__bindgen_ty_1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_eth_conf__bindgen_ty_2 {
pub vmdq_dcb_tx_conf: __BindgenUnionField<rte_eth_vmdq_dcb_tx_conf>,
pub dcb_tx_conf: __BindgenUnionField<rte_eth_dcb_tx_conf>,
diff --git a/tests/expectations/tests/layout_mbuf.rs b/tests/expectations/tests/layout_mbuf.rs
index 2cfd88ab..b336e548 100644
--- a/tests/expectations/tests/layout_mbuf.rs
+++ b/tests/expectations/tests/layout_mbuf.rs
@@ -12,7 +12,7 @@ pub type MARKER8 = [u8; 0usize];
pub type MARKER64 = [u64; 0usize];
/// The atomic counter structure.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_atomic16_t {
/// < An internal counter value.
pub cnt: i16,
@@ -128,7 +128,7 @@ pub union rte_mbuf__bindgen_ty_2 {
_bindgen_union_align: u32,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
pub _bitfield_1: [u8; 4usize],
pub __bindgen_align: [u32; 0usize],
@@ -480,7 +480,7 @@ pub union rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
_bindgen_union_align: u32,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
pub hash: u16,
pub id: u16,
@@ -570,7 +570,7 @@ impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
pub lo: u32,
pub hi: u32,
@@ -679,7 +679,7 @@ pub union rte_mbuf__bindgen_ty_5 {
_bindgen_union_align: u64,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
pub _bitfield_1: [u16; 4usize],
pub __bindgen_align: [u64; 0usize],
@@ -1079,7 +1079,7 @@ impl Default for rte_mbuf {
}
/// < Pool from which mbuf was allocated.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mempool {
pub _address: u8,
}
diff --git a/tests/expectations/tests/layout_mbuf_1_0.rs b/tests/expectations/tests/layout_mbuf_1_0.rs
index 5e08af3c..afe46930 100644
--- a/tests/expectations/tests/layout_mbuf_1_0.rs
+++ b/tests/expectations/tests/layout_mbuf_1_0.rs
@@ -31,6 +31,9 @@ impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
}
+impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
+ fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true }
+}
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
pub type phys_addr_t = u64;
@@ -39,7 +42,7 @@ pub type MARKER8 = [u8; 0usize];
pub type MARKER64 = [u64; 0usize];
/// The atomic counter structure.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_atomic16_t {
/// < An internal counter value.
pub cnt: i16,
@@ -113,7 +116,7 @@ pub struct rte_mbuf {
/// or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC
/// config option.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_1 {
/// < Atomically accessed refcnt
pub refcnt_atomic: __BindgenUnionField<rte_atomic16_t>,
@@ -144,7 +147,7 @@ impl Clone for rte_mbuf__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_2 {
/// < L2/L3/L4 and tunnel information.
pub packet_type: __BindgenUnionField<u32>,
@@ -152,7 +155,7 @@ pub struct rte_mbuf__bindgen_ty_2 {
pub bindgen_union_field: u32,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
pub _bitfield_1: [u8; 4usize],
pub __bindgen_align: [u32; 0usize],
@@ -475,7 +478,7 @@ impl Clone for rte_mbuf__bindgen_ty_2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3 {
/// < RSS hash result if RSS enabled
pub rss: __BindgenUnionField<u32>,
@@ -488,20 +491,20 @@ pub struct rte_mbuf__bindgen_ty_3 {
pub bindgen_union_field: [u32; 2usize],
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
pub __bindgen_anon_1: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1,
pub hi: u32,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>,
pub lo: __BindgenUnionField<u32>,
pub bindgen_union_field: u32,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
pub hash: u16,
pub id: u16,
@@ -585,7 +588,7 @@ impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
pub lo: u32,
pub hi: u32,
@@ -649,7 +652,7 @@ impl Clone for rte_mbuf__bindgen_ty_3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_4 {
/// < Can be used for external metadata
pub userdata: __BindgenUnionField<*mut ::std::os::raw::c_void>,
@@ -680,7 +683,7 @@ impl Clone for rte_mbuf__bindgen_ty_4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_5 {
/// < combined for easy fetch
pub tx_offload: __BindgenUnionField<u64>,
@@ -688,7 +691,7 @@ pub struct rte_mbuf__bindgen_ty_5 {
pub bindgen_union_field: u64,
}
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
pub _bitfield_1: [u16; 4usize],
pub __bindgen_align: [u64; 0usize],
@@ -1085,7 +1088,7 @@ impl Default for rte_mbuf {
}
/// < Pool from which mbuf was allocated.
#[repr(C)]
-#[derive(Debug, Default, Copy, Hash)]
+#[derive(Debug, Default, Copy, Hash, PartialEq)]
pub struct rte_mempool {
pub _address: u8,
}
diff --git a/tests/headers/issue-648-derive-debug-with-padding.h b/tests/headers/issue-648-derive-debug-with-padding.h
index fbe98678..e3433b07 100644
--- a/tests/headers/issue-648-derive-debug-with-padding.h
+++ b/tests/headers/issue-648-derive-debug-with-padding.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
/**
* We emit a `[u8; 63usize]` padding field for this struct, which cannot derive
* Debug/Hash because 63 is over the hard coded limit. (Yes, this struct doesn't end
@@ -11,8 +11,8 @@ struct NoDebug {
} __attribute__((__aligned__(64)));
/**
- * This should derive Debug/Hash because the padding size is less than the max derive
- * Debug/Hash impl for arrays. However, we conservatively don't derive Debug/Hash because
+ * This should derive Debug/Hash/PartialEq because the padding size is less than the max derive
+ * Debug/Hash/PartialEq impl for arrays. However, we conservatively don't derive Debug/Hash because
* we determine Debug derive-ability before we compute padding, which happens at
* codegen. (Again, we expect to get the alignment wrong for similar reasons.)
*/
diff --git a/tests/headers/layout_array.h b/tests/headers/layout_array.h
index fb071df6..9db81f91 100644
--- a/tests/headers/layout_array.h
+++ b/tests/headers/layout_array.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
diff --git a/tests/headers/layout_array_too_long.h b/tests/headers/layout_array_too_long.h
index 61f0c269..9db20a36 100644
--- a/tests/headers/layout_array_too_long.h
+++ b/tests/headers/layout_array_too_long.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
diff --git a/tests/headers/layout_eth_conf.h b/tests/headers/layout_eth_conf.h
index ae3edad4..3c09f9f5 100644
--- a/tests/headers/layout_eth_conf.h
+++ b/tests/headers/layout_eth_conf.h
@@ -1,5 +1,4 @@
-// bindgen-flags: --with-derive-hash
-
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
diff --git a/tests/headers/layout_eth_conf_1_0.h b/tests/headers/layout_eth_conf_1_0.h
index ed9c68ba..7fcbcddb 100644
--- a/tests/headers/layout_eth_conf_1_0.h
+++ b/tests/headers/layout_eth_conf_1_0.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --rust-target 1.0 --with-derive-hash
+// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
diff --git a/tests/headers/layout_mbuf.h b/tests/headers/layout_mbuf.h
index 9166bac7..0e82846b 100644
--- a/tests/headers/layout_mbuf.h
+++ b/tests/headers/layout_mbuf.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash
+// bindgen-flags: --with-derive-hash --with-derive-partialeq
#define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */
diff --git a/tests/headers/layout_mbuf_1_0.h b/tests/headers/layout_mbuf_1_0.h
index 18ca60c1..ed815acb 100644
--- a/tests/headers/layout_mbuf_1_0.h
+++ b/tests/headers/layout_mbuf_1_0.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --rust-target 1.0 --with-derive-hash
+// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq
#define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */