diff options
author | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-16 21:22:51 -0500 |
---|---|---|
committer | Zhiting Zhu <zhitingz@cs.utexas.edu> | 2017-08-21 16:14:41 -0500 |
commit | bca8be63ab6e7a8be327bacadca33abe9bc18d4c (patch) | |
tree | f4401ea9cc3ebcddcf3cb2be047b3fd3d5356aed /tests | |
parent | b87f4ba8ba8851cc9f8cbd06cbaf348c689aa402 (diff) |
Layout related tests for derive Eq
Diffstat (limited to 'tests')
-rw-r--r-- | tests/expectations/tests/issue-648-derive-debug-with-padding.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/layout_array.rs | 6 | ||||
-rw-r--r-- | tests/expectations/tests/layout_array_too_long.rs | 8 | ||||
-rw-r--r-- | tests/expectations/tests/layout_eth_conf.rs | 34 | ||||
-rw-r--r-- | tests/expectations/tests/layout_eth_conf_1_0.rs | 37 | ||||
-rw-r--r-- | tests/expectations/tests/layout_mbuf.rs | 12 | ||||
-rw-r--r-- | tests/expectations/tests/layout_mbuf_1_0.rs | 27 | ||||
-rw-r--r-- | tests/headers/issue-648-derive-debug-with-padding.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_array.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_array_too_long.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_eth_conf.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_eth_conf_1_0.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_mbuf.h | 2 | ||||
-rw-r--r-- | tests/headers/layout_mbuf_1_0.h | 2 |
14 files changed, 72 insertions, 70 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 b77b0e60..85937c3f 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/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 +/// This should derive Debug/Hash/PartialEq/Eq because the padding size is less than the max derive +/// Debug/Hash/PartialEq/Eq 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 081000bd..9f2082ec 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 b68d9a33..1a3da41e 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 1926ae7c..38c105d3 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 b845321e..c03a3dd4 100644 --- a/tests/expectations/tests/layout_eth_conf_1_0.rs +++ b/tests/expectations/tests/layout_eth_conf_1_0.rs @@ -34,6 +34,7 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> { impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> { fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true } } +impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { } 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; @@ -82,7 +83,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] 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, @@ -500,7 +501,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_txmode { /// < TX multi-queues mode. pub mq_mode: rte_eth_tx_mq_mode, @@ -671,7 +672,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_rss_conf { /// < If not NULL, 40-byte hash key. pub rss_key: *mut u8, @@ -748,7 +749,7 @@ pub struct rte_eth_vmdq_dcb_conf { pub dcb_tc: [u8; 8usize], } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 { /// < The vlan id of the received frame pub vlan_id: u16, @@ -828,7 +829,7 @@ impl Default for rte_eth_vmdq_dcb_conf { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_dcb_rx_conf { /// < Possible DCB TCs, 4 or 8 TCs pub nb_tcs: rte_eth_nb_tcs, @@ -860,7 +861,7 @@ impl Default for rte_eth_dcb_rx_conf { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_dcb_tx_conf { /// < With DCB, 16 or 32 pools. pub nb_queue_pools: rte_eth_nb_pools, @@ -894,7 +895,7 @@ impl Default for rte_eth_vmdq_dcb_tx_conf { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_dcb_tx_conf { /// < Possible DCB TCs, 4 or 8 TCs. pub nb_tcs: rte_eth_nb_tcs, @@ -926,7 +927,7 @@ impl Default for rte_eth_dcb_tx_conf { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Copy, Hash, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_tx_conf { /// < VMDq mode, 64 pools. pub nb_queue_pools: rte_eth_nb_pools, @@ -969,7 +970,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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 { /// < The vlan id of the received frame pub vlan_id: u16, @@ -1082,7 +1083,7 @@ pub enum rte_fdir_status_mode { } /// A structure used to define the input for IPV4 flow #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_ipv4_flow { /// < IPv4 source address in big endian. pub src_ip: u32, @@ -1132,7 +1133,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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_ipv6_flow { /// < IPv6 source address in big endian. pub src_ip: [u32; 4usize], @@ -1183,7 +1184,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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_fdir_masks { /// < Bit mask for vlan_tci in big endian pub vlan_tci_mask: u16, @@ -1269,7 +1270,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_flex_payload_cfg { /// < Payload type pub type_: rte_eth_payload_type, @@ -1304,7 +1305,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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_fdir_flex_mask { pub flow_type: u16, pub mask: [u8; 16usize], @@ -1334,7 +1335,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_fdir_flex_conf { /// < The number of following payload cfg pub nb_payloads: u16, @@ -1383,7 +1384,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, PartialEq)] +#[derive(Debug, Copy, Hash, PartialEq, Eq)] pub struct rte_fdir_conf { /// < Flow Director mode. pub mode: rte_fdir_mode, @@ -1441,7 +1442,7 @@ impl Default for rte_fdir_conf { } /// A structure used to enable/disable specific device interrupts. #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_intr_conf { /// enable/disable lsc interrupt. 0 (default) - disable, 1 enable pub lsc: u16, @@ -1554,7 +1555,7 @@ impl Default for rte_eth_conf__bindgen_ty_1 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 b336e548..63cd92bb 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 afe46930..b9c6e69b 100644 --- a/tests/expectations/tests/layout_mbuf_1_0.rs +++ b/tests/expectations/tests/layout_mbuf_1_0.rs @@ -34,6 +34,7 @@ impl <T> ::std::hash::Hash for __BindgenUnionField<T> { impl <T> ::std::cmp::PartialEq for __BindgenUnionField<T> { fn eq(&self, _other: &__BindgenUnionField<T>) -> bool { true } } +impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { } 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; @@ -42,7 +43,7 @@ pub type MARKER8 = [u8; 0usize]; pub type MARKER64 = [u64; 0usize]; /// The atomic counter structure. #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_atomic16_t { /// < An internal counter value. pub cnt: i16, @@ -116,7 +117,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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_1 { /// < Atomically accessed refcnt pub refcnt_atomic: __BindgenUnionField<rte_atomic16_t>, @@ -147,7 +148,7 @@ impl Clone for rte_mbuf__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_2 { /// < L2/L3/L4 and tunnel information. pub packet_type: __BindgenUnionField<u32>, @@ -155,7 +156,7 @@ pub struct rte_mbuf__bindgen_ty_2 { pub bindgen_union_field: u32, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 { pub _bitfield_1: [u8; 4usize], pub __bindgen_align: [u32; 0usize], @@ -478,7 +479,7 @@ impl Clone for rte_mbuf__bindgen_ty_2 { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_3 { /// < RSS hash result if RSS enabled pub rss: __BindgenUnionField<u32>, @@ -491,20 +492,20 @@ pub struct rte_mbuf__bindgen_ty_3 { pub bindgen_union_field: [u32; 2usize], } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { pub hash: u16, pub id: u16, @@ -588,7 +589,7 @@ impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 { pub lo: u32, pub hi: u32, @@ -652,7 +653,7 @@ impl Clone for rte_mbuf__bindgen_ty_3 { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_4 { /// < Can be used for external metadata pub userdata: __BindgenUnionField<*mut ::std::os::raw::c_void>, @@ -683,7 +684,7 @@ impl Clone for rte_mbuf__bindgen_ty_4 { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_5 { /// < combined for easy fetch pub tx_offload: __BindgenUnionField<u64>, @@ -691,7 +692,7 @@ pub struct rte_mbuf__bindgen_ty_5 { pub bindgen_union_field: u64, } #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 { pub _bitfield_1: [u16; 4usize], pub __bindgen_align: [u64; 0usize], @@ -1088,7 +1089,7 @@ impl Default for rte_mbuf { } /// < Pool from which mbuf was allocated. #[repr(C)] -#[derive(Debug, Default, Copy, Hash, PartialEq)] +#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] 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 e3433b07..2ef70e47 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 --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq /** * 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 diff --git a/tests/headers/layout_array.h b/tests/headers/layout_array.h index 9db81f91..6a20f7c3 100644 --- a/tests/headers/layout_array.h +++ b/tests/headers/layout_array.h @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq 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 9db20a36..5240f040 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 --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq 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 3c09f9f5..637b5696 100644 --- a/tests/headers/layout_eth_conf.h +++ b/tests/headers/layout_eth_conf.h @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq 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 7fcbcddb..285c8c7a 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 --with-derive-partialeq +// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq 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 0e82846b..0e342f45 100644 --- a/tests/headers/layout_mbuf.h +++ b/tests/headers/layout_mbuf.h @@ -1,4 +1,4 @@ -// bindgen-flags: --with-derive-hash --with-derive-partialeq +// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq #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 ed815acb..2854de50 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 --with-derive-partialeq +// bindgen-flags: --rust-target 1.0 --with-derive-hash --with-derive-partialeq --with-derive-eq #define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */ |