summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/annotation_hide.rs52
-rw-r--r--tests/expectations/tests/bitfield-32bit-overflow.rs1462
-rw-r--r--tests/expectations/tests/bitfield-method-same-name.rs57
-rw-r--r--tests/expectations/tests/bitfield_align.rs1131
-rw-r--r--tests/expectations/tests/bitfield_align_2.rs94
-rw-r--r--tests/expectations/tests/bitfield_method_mangling.rs88
-rw-r--r--tests/expectations/tests/blacklist-and-impl-debug.rs38
-rw-r--r--tests/expectations/tests/class_nested.rs150
-rw-r--r--tests/expectations/tests/class_use_as.rs67
-rw-r--r--tests/expectations/tests/class_with_dtor.rs56
-rw-r--r--tests/expectations/tests/constify-all-enums.rs37
-rw-r--r--tests/expectations/tests/constify-module-enums-basic.rs51
-rw-r--r--tests/expectations/tests/constify-module-enums-simple-alias.rs142
-rw-r--r--tests/expectations/tests/default-template-parameter.rs30
-rw-r--r--tests/expectations/tests/derive-debug-bitfield.rs118
-rw-r--r--tests/expectations/tests/derive-debug-generic.rs10
-rw-r--r--tests/expectations/tests/derive-default-and-blacklist.rs36
-rw-r--r--tests/expectations/tests/derive-hash-and-blacklist.rs35
-rw-r--r--tests/expectations/tests/derive-hash-blacklisting.rs74
-rw-r--r--tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs82
-rw-r--r--tests/expectations/tests/derive-hash-struct-with-float-array.rs34
-rw-r--r--tests/expectations/tests/derive-hash-struct-with-pointer.rs149
-rw-r--r--tests/expectations/tests/derive-hash-template-def-float.rs7
-rw-r--r--tests/expectations/tests/derive-hash-template-inst-float.rs106
-rw-r--r--tests/expectations/tests/derive-partialeq-and-blacklist.rs36
-rw-r--r--tests/expectations/tests/forward-declaration-autoptr.rs58
-rw-r--r--tests/expectations/tests/gen-constructors.rs18
-rw-r--r--tests/expectations/tests/issue-410.rs23
-rw-r--r--tests/expectations/tests/issue-447.rs56
-rw-r--r--tests/expectations/tests/issue-648-derive-debug-with-padding.rs77
-rw-r--r--tests/expectations/tests/issue-848-replacement-system-include.rs7
-rw-r--r--tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs34
-rw-r--r--tests/expectations/tests/issue_315.rs1
-rw-r--r--tests/expectations/tests/jsval_layout_opaque.rs388
-rw-r--r--tests/expectations/tests/jsval_layout_opaque_1_0.rs412
-rw-r--r--tests/expectations/tests/layout_align.rs169
-rw-r--r--tests/expectations/tests/layout_cmdline_token.rs281
-rw-r--r--tests/expectations/tests/layout_eth_conf.rs2188
-rw-r--r--tests/expectations/tests/layout_eth_conf_1_0.rs2224
-rw-r--r--tests/expectations/tests/layout_mbuf.rs1404
-rw-r--r--tests/expectations/tests/layout_mbuf_1_0.rs1419
-rw-r--r--tests/expectations/tests/libclang-3.8/auto.rs20
-rw-r--r--tests/expectations/tests/libclang-3.8/call-conv-field.rs60
-rw-r--r--tests/expectations/tests/libclang-3.8/const_bool.rs24
-rw-r--r--tests/expectations/tests/libclang-3.8/constant-evaluate.rs10
-rw-r--r--tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs33
-rw-r--r--tests/expectations/tests/libclang-3.8/objc_template.rs10
-rw-r--r--tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs18
-rw-r--r--tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs33
-rw-r--r--tests/expectations/tests/libclang-3.9/auto.rs18
-rw-r--r--tests/expectations/tests/libclang-3.9/call-conv-field.rs60
-rw-r--r--tests/expectations/tests/libclang-3.9/const_bool.rs18
-rw-r--r--tests/expectations/tests/libclang-3.9/constant-evaluate.rs9
-rw-r--r--tests/expectations/tests/libclang-3.9/issue-769-bad-instantiation-test.rs33
-rw-r--r--tests/expectations/tests/libclang-3.9/objc_template.rs10
-rw-r--r--tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs18
-rw-r--r--tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs33
-rw-r--r--tests/expectations/tests/libclang-4/constant-evaluate.rs9
-rw-r--r--tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs33
-rw-r--r--tests/expectations/tests/libclang-4/type_alias_template_specialized.rs54
-rw-r--r--tests/expectations/tests/macro_const.rs8
-rw-r--r--tests/expectations/tests/mangling-win32.rs18
-rw-r--r--tests/expectations/tests/namespace.rs63
-rw-r--r--tests/expectations/tests/no-derive-debug.rs55
-rw-r--r--tests/expectations/tests/no-derive-default.rs51
-rw-r--r--tests/expectations/tests/no_copy.rs1
-rw-r--r--tests/expectations/tests/nsBaseHashtable.rs50
-rw-r--r--tests/expectations/tests/objc_class_method.rs66
-rw-r--r--tests/expectations/tests/objc_method.rs51
-rw-r--r--tests/expectations/tests/objc_method_clash.rs13
-rw-r--r--tests/expectations/tests/objc_property_fnptr.rs36
-rw-r--r--tests/expectations/tests/objc_whitelist.rs32
-rw-r--r--tests/expectations/tests/only_bitfields.rs82
-rw-r--r--tests/expectations/tests/opaque-template-inst-member-2.rs93
-rw-r--r--tests/expectations/tests/opaque-template-instantiation-namespaced.rs161
-rw-r--r--tests/expectations/tests/opaque-template-instantiation.rs99
-rw-r--r--tests/expectations/tests/opaque_in_struct.rs52
-rw-r--r--tests/expectations/tests/opaque_pointer.rs89
-rw-r--r--tests/expectations/tests/replace_template_alias.rs7
-rw-r--r--tests/expectations/tests/replace_use.rs53
-rw-r--r--tests/expectations/tests/struct_typedef_ns.rs84
-rw-r--r--tests/expectations/tests/struct_with_bitfields.rs241
-rw-r--r--tests/expectations/tests/template.rs646
-rw-r--r--tests/expectations/tests/template_typedefs.rs11
-rw-r--r--tests/expectations/tests/union_with_anon_struct_bitfield.rs117
-rw-r--r--tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs153
-rw-r--r--tests/expectations/tests/weird_bitfields.rs458
-rw-r--r--tests/headers/nsBaseHashtable.hpp48
-rw-r--r--tests/rustfmt.toml0
-rwxr-xr-xtests/stylo_sanity.rs1035
-rwxr-xr-xtests/test-one.sh6
-rw-r--r--tests/tests.rs172
92 files changed, 10247 insertions, 7208 deletions
diff --git a/tests/expectations/tests/annotation_hide.rs b/tests/expectations/tests/annotation_hide.rs
index 7305091a..0cd443a7 100644
--- a/tests/expectations/tests/annotation_hide.rs
+++ b/tests/expectations/tests/annotation_hide.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen opaque></div>
#[repr(C)]
#[derive(Debug, Default, Copy)]
@@ -12,13 +13,21 @@ pub struct D {
}
#[test]
fn bindgen_test_layout_D() {
- assert_eq!(::std::mem::size_of::<D>() , 4usize , concat ! (
- "Size of: " , stringify ! ( D ) ));
- assert_eq! (::std::mem::align_of::<D>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( D ) ));
+ assert_eq!(
+ ::std::mem::size_of::<D>(),
+ 4usize,
+ concat!("Size of: ", stringify!(D))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<D>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(D))
+ );
}
impl Clone for D {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
@@ -27,16 +36,29 @@ pub struct NotAnnotated {
}
#[test]
fn bindgen_test_layout_NotAnnotated() {
- assert_eq!(::std::mem::size_of::<NotAnnotated>() , 4usize , concat ! (
- "Size of: " , stringify ! ( NotAnnotated ) ));
- assert_eq! (::std::mem::align_of::<NotAnnotated>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( NotAnnotated ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const NotAnnotated ) ) . f as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( NotAnnotated ) , "::" ,
- stringify ! ( f ) ));
+ assert_eq!(
+ ::std::mem::size_of::<NotAnnotated>(),
+ 4usize,
+ concat!("Size of: ", stringify!(NotAnnotated))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<NotAnnotated>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(NotAnnotated))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const NotAnnotated)).f as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(NotAnnotated),
+ "::",
+ stringify!(f)
+ )
+ );
}
impl Clone for NotAnnotated {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/bitfield-32bit-overflow.rs b/tests/expectations/tests/bitfield-32bit-overflow.rs
index d179ddf9..9f7ea2e9 100644
--- a/tests/expectations/tests/bitfield-32bit-overflow.rs
+++ b/tests/expectations/tests/bitfield-32bit-overflow.rs
@@ -12,24 +12,32 @@ pub struct MuchBitfield {
}
#[test]
fn bindgen_test_layout_MuchBitfield() {
- assert_eq!(::std::mem::size_of::<MuchBitfield>() , 5usize , concat ! (
- "Size of: " , stringify ! ( MuchBitfield ) ));
- assert_eq! (::std::mem::align_of::<MuchBitfield>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( MuchBitfield ) ));
+ assert_eq!(
+ ::std::mem::size_of::<MuchBitfield>(),
+ 5usize,
+ concat!("Size of: ", stringify!(MuchBitfield))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<MuchBitfield>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(MuchBitfield))
+ );
}
impl Clone for MuchBitfield {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl MuchBitfield {
#[inline]
pub fn m0(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -41,31 +49,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m1(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 2u64 as u64;
let val = (unit_field_val & mask) >> 1usize;
@@ -77,31 +85,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m2(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 4u64 as u64;
let val = (unit_field_val & mask) >> 2usize;
@@ -113,31 +121,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m3(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 8u64 as u64;
let val = (unit_field_val & mask) >> 3usize;
@@ -149,31 +157,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m4(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 16u64 as u64;
let val = (unit_field_val & mask) >> 4usize;
@@ -185,31 +193,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m5(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 32u64 as u64;
let val = (unit_field_val & mask) >> 5usize;
@@ -221,31 +229,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 5usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m6(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 64u64 as u64;
let val = (unit_field_val & mask) >> 6usize;
@@ -257,31 +265,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m7(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 128u64 as u64;
let val = (unit_field_val & mask) >> 7usize;
@@ -293,31 +301,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m8(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 256u64 as u64;
let val = (unit_field_val & mask) >> 8usize;
@@ -329,31 +337,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m9(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 512u64 as u64;
let val = (unit_field_val & mask) >> 9usize;
@@ -365,31 +373,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 9usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m10(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1024u64 as u64;
let val = (unit_field_val & mask) >> 10usize;
@@ -401,31 +409,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 10usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m11(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 2048u64 as u64;
let val = (unit_field_val & mask) >> 11usize;
@@ -437,31 +445,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 11usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m12(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 4096u64 as u64;
let val = (unit_field_val & mask) >> 12usize;
@@ -473,31 +481,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 12usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m13(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 8192u64 as u64;
let val = (unit_field_val & mask) >> 13usize;
@@ -509,31 +517,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 13usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m14(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 16384u64 as u64;
let val = (unit_field_val & mask) >> 14usize;
@@ -545,31 +553,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 14usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m15(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 32768u64 as u64;
let val = (unit_field_val & mask) >> 15usize;
@@ -581,31 +589,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 15usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m16(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 65536u64 as u64;
let val = (unit_field_val & mask) >> 16usize;
@@ -617,31 +625,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m17(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 131072u64 as u64;
let val = (unit_field_val & mask) >> 17usize;
@@ -653,31 +661,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 17usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m18(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 262144u64 as u64;
let val = (unit_field_val & mask) >> 18usize;
@@ -689,31 +697,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 18usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m19(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 524288u64 as u64;
let val = (unit_field_val & mask) >> 19usize;
@@ -725,31 +733,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 19usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m20(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1048576u64 as u64;
let val = (unit_field_val & mask) >> 20usize;
@@ -761,31 +769,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 20usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m21(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 2097152u64 as u64;
let val = (unit_field_val & mask) >> 21usize;
@@ -797,31 +805,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 21usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m22(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 4194304u64 as u64;
let val = (unit_field_val & mask) >> 22usize;
@@ -833,31 +841,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 22usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m23(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 8388608u64 as u64;
let val = (unit_field_val & mask) >> 23usize;
@@ -869,31 +877,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 23usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m24(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 16777216u64 as u64;
let val = (unit_field_val & mask) >> 24usize;
@@ -905,31 +913,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m25(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 33554432u64 as u64;
let val = (unit_field_val & mask) >> 25usize;
@@ -941,31 +949,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 25usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m26(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 67108864u64 as u64;
let val = (unit_field_val & mask) >> 26usize;
@@ -977,31 +985,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 26usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m27(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 134217728u64 as u64;
let val = (unit_field_val & mask) >> 27usize;
@@ -1013,31 +1021,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 27usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m28(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 268435456u64 as u64;
let val = (unit_field_val & mask) >> 28usize;
@@ -1049,31 +1057,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 28usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m29(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 536870912u64 as u64;
let val = (unit_field_val & mask) >> 29usize;
@@ -1085,31 +1093,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 29usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m30(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1073741824u64 as u64;
let val = (unit_field_val & mask) >> 30usize;
@@ -1121,31 +1129,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 30usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m31(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 2147483648u64 as u64;
let val = (unit_field_val & mask) >> 31usize;
@@ -1157,31 +1165,31 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 31usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn m32(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 4294967296u64 as u64;
let val = (unit_field_val & mask) >> 32usize;
@@ -1193,408 +1201,90 @@ impl MuchBitfield {
let val = val as u8 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 32usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(m0: ::std::os::raw::c_char,
- m1: ::std::os::raw::c_char,
- m2: ::std::os::raw::c_char,
- m3: ::std::os::raw::c_char,
- m4: ::std::os::raw::c_char,
- m5: ::std::os::raw::c_char,
- m6: ::std::os::raw::c_char,
- m7: ::std::os::raw::c_char,
- m8: ::std::os::raw::c_char,
- m9: ::std::os::raw::c_char,
- m10: ::std::os::raw::c_char,
- m11: ::std::os::raw::c_char,
- m12: ::std::os::raw::c_char,
- m13: ::std::os::raw::c_char,
- m14: ::std::os::raw::c_char,
- m15: ::std::os::raw::c_char,
- m16: ::std::os::raw::c_char,
- m17: ::std::os::raw::c_char,
- m18: ::std::os::raw::c_char,
- m19: ::std::os::raw::c_char,
- m20: ::std::os::raw::c_char,
- m21: ::std::os::raw::c_char,
- m22: ::std::os::raw::c_char,
- m23: ::std::os::raw::c_char,
- m24: ::std::os::raw::c_char,
- m25: ::std::os::raw::c_char,
- m26: ::std::os::raw::c_char,
- m27: ::std::os::raw::c_char,
- m28: ::std::os::raw::c_char,
- m29: ::std::os::raw::c_char,
- m30: ::std::os::raw::c_char,
- m31: ::std::os::raw::c_char,
- m32: ::std::os::raw::c_char) -> u64 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- 0
- }
- |
- ((m0
- as
- u8
- as
- u64)
- <<
- 0usize)
- &
- (1u64
- as
- u64))
- }
- |
- ((m1
- as
- u8
- as
- u64)
- <<
- 1usize)
- &
- (2u64
- as
- u64))
- }
- |
- ((m2
- as
- u8
- as
- u64)
- <<
- 2usize)
- &
- (4u64
- as
- u64))
- }
- |
- ((m3
- as
- u8
- as
- u64)
- <<
- 3usize)
- &
- (8u64
- as
- u64))
- }
- |
- ((m4
- as
- u8
- as
- u64)
- <<
- 4usize)
- &
- (16u64
- as
- u64))
- }
- |
- ((m5
- as
- u8
- as
- u64)
- <<
- 5usize)
- &
- (32u64
- as
- u64))
- }
- |
- ((m6
- as
- u8
- as
- u64)
- <<
- 6usize)
- &
- (64u64
- as
- u64))
- }
- |
- ((m7
- as
- u8
- as
- u64)
- <<
- 7usize)
- &
- (128u64
- as
- u64))
- }
- |
- ((m8
- as
- u8
- as
- u64)
- <<
- 8usize)
- &
- (256u64
- as
- u64))
- }
- |
- ((m9
- as
- u8
- as
- u64)
- <<
- 9usize)
- &
- (512u64
- as
- u64))
- }
- |
- ((m10
- as
- u8
- as
- u64)
- <<
- 10usize)
- &
- (1024u64
- as
- u64))
- }
- |
- ((m11
- as
- u8
- as
- u64)
- <<
- 11usize)
- &
- (2048u64
- as
- u64))
- }
- |
- ((m12
- as
- u8
- as
- u64)
- <<
- 12usize)
- &
- (4096u64
- as
- u64))
- }
- |
- ((m13
- as
- u8
- as
- u64)
- <<
- 13usize)
- &
- (8192u64
- as
- u64))
- }
- |
- ((m14
- as
- u8
- as
- u64)
- <<
- 14usize)
- &
- (16384u64
- as
- u64))
- }
- |
- ((m15
- as
- u8
- as
- u64)
- <<
- 15usize)
- &
- (32768u64
- as
- u64))
- }
- |
- ((m16
- as
- u8
- as
- u64)
- <<
- 16usize)
- &
- (65536u64
- as
- u64))
- }
- |
- ((m17
- as
- u8
- as
- u64)
- <<
- 17usize)
- &
- (131072u64
- as
- u64))
- }
- |
- ((m18
- as
- u8
- as
- u64)
- <<
- 18usize)
- &
- (262144u64
- as
- u64))
- } |
- ((m19
- as
- u8
- as
- u64)
- <<
- 19usize)
- &
- (524288u64
- as
- u64))
- } |
- ((m20
- as
- u8
- as
- u64)
- <<
- 20usize)
- &
- (1048576u64
- as
- u64))
- } |
- ((m21 as
- u8
- as
- u64)
- <<
- 21usize)
- &
- (2097152u64
- as
- u64))
- } |
- ((m22 as u8 as
- u64) <<
- 22usize) &
- (4194304u64
- as
- u64))
- } |
- ((m23 as u8 as u64)
- << 23usize) &
- (8388608u64 as
- u64))
- } |
- ((m24 as u8 as u64) <<
- 24usize) &
- (16777216u64 as u64))
- } |
- ((m25 as u8 as u64) <<
- 25usize) &
- (33554432u64 as u64))
- } |
- ((m26 as u8 as u64) << 26usize) &
- (67108864u64 as u64))
- } |
- ((m27 as u8 as u64) << 27usize) &
- (134217728u64 as u64))
- } |
- ((m28 as u8 as u64) << 28usize) &
- (268435456u64 as u64))
- } |
- ((m29 as u8 as u64) << 29usize) &
- (536870912u64 as u64))
- } |
- ((m30 as u8 as u64) << 30usize) &
- (1073741824u64 as u64))
- } | ((m31 as u8 as u64) << 31usize) & (2147483648u64 as u64))
- } | ((m32 as u8 as u64) << 32usize) & (4294967296u64 as u64))
+ pub fn new_bitfield_1(
+ m0: ::std::os::raw::c_char,
+ m1: ::std::os::raw::c_char,
+ m2: ::std::os::raw::c_char,
+ m3: ::std::os::raw::c_char,
+ m4: ::std::os::raw::c_char,
+ m5: ::std::os::raw::c_char,
+ m6: ::std::os::raw::c_char,
+ m7: ::std::os::raw::c_char,
+ m8: ::std::os::raw::c_char,
+ m9: ::std::os::raw::c_char,
+ m10: ::std::os::raw::c_char,
+ m11: ::std::os::raw::c_char,
+ m12: ::std::os::raw::c_char,
+ m13: ::std::os::raw::c_char,
+ m14: ::std::os::raw::c_char,
+ m15: ::std::os::raw::c_char,
+ m16: ::std::os::raw::c_char,
+ m17: ::std::os::raw::c_char,
+ m18: ::std::os::raw::c_char,
+ m19: ::std::os::raw::c_char,
+ m20: ::std::os::raw::c_char,
+ m21: ::std::os::raw::c_char,
+ m22: ::std::os::raw::c_char,
+ m23: ::std::os::raw::c_char,
+ m24: ::std::os::raw::c_char,
+ m25: ::std::os::raw::c_char,
+ m26: ::std::os::raw::c_char,
+ m27: ::std::os::raw::c_char,
+ m28: ::std::os::raw::c_char,
+ m29: ::std::os::raw::c_char,
+ m30: ::std::os::raw::c_char,
+ m31: ::std::os::raw::c_char,
+ m32: ::std::os::raw::c_char,
+ ) -> u64 {
+ (((((((((((((((((((((((((((((((((0 | ((m0 as u8 as u64) << 0usize) & (1u64 as u64)) |
+ ((m1 as u8 as u64) << 1usize) & (2u64 as u64)) |
+ ((m2 as u8 as u64) << 2usize) & (4u64 as u64)) |
+ ((m3 as u8 as u64) << 3usize) & (8u64 as u64)) |
+ ((m4 as u8 as u64) << 4usize) & (16u64 as u64)) |
+ ((m5 as u8 as u64) << 5usize) & (32u64 as u64)) |
+ ((m6 as u8 as u64) << 6usize) & (64u64 as u64)) |
+ ((m7 as u8 as u64) << 7usize) & (128u64 as u64)) |
+ ((m8 as u8 as u64) << 8usize) & (256u64 as u64)) |
+ ((m9 as u8 as u64) << 9usize) & (512u64 as u64)) |
+ ((m10 as u8 as u64) << 10usize) & (1024u64 as u64)) |
+ ((m11 as u8 as u64) << 11usize) & (2048u64 as u64)) |
+ ((m12 as u8 as u64) << 12usize) & (4096u64 as u64)) |
+ ((m13 as u8 as u64) << 13usize) & (8192u64 as u64)) |
+ ((m14 as u8 as u64) << 14usize) & (16384u64 as u64)) |
+ ((m15 as u8 as u64) << 15usize) & (32768u64 as u64)) |
+ ((m16 as u8 as u64) << 16usize) & (65536u64 as u64)) |
+ ((m17 as u8 as u64) << 17usize) & (131072u64 as u64)) |
+ ((m18 as u8 as u64) << 18usize) & (262144u64 as u64)) |
+ ((m19 as u8 as u64) << 19usize) & (524288u64 as u64)) |
+ ((m20 as u8 as u64) << 20usize) & (1048576u64 as u64)) |
+ ((m21 as u8 as u64) << 21usize) & (2097152u64 as u64)) |
+ ((m22 as u8 as u64) << 22usize) & (4194304u64 as u64)) |
+ ((m23 as u8 as u64) << 23usize) & (8388608u64 as u64)) |
+ ((m24 as u8 as u64) << 24usize) & (16777216u64 as u64)) |
+ ((m25 as u8 as u64) << 25usize) & (33554432u64 as u64)) |
+ ((m26 as u8 as u64) << 26usize) & (67108864u64 as u64)) |
+ ((m27 as u8 as u64) << 27usize) & (134217728u64 as u64)) |
+ ((m28 as u8 as u64) << 28usize) & (268435456u64 as u64)) |
+ ((m29 as u8 as u64) << 29usize) & (536870912u64 as u64)) |
+ ((m30 as u8 as u64) << 30usize) & (1073741824u64 as u64)) |
+ ((m31 as u8 as u64) << 31usize) & (2147483648u64 as u64)) |
+ ((m32 as u8 as u64) << 32usize) & (4294967296u64 as u64))
}
}
diff --git a/tests/expectations/tests/bitfield-method-same-name.rs b/tests/expectations/tests/bitfield-method-same-name.rs
index dd6b286f..be55ce38 100644
--- a/tests/expectations/tests/bitfield-method-same-name.rs
+++ b/tests/expectations/tests/bitfield-method-same-name.rs
@@ -12,10 +12,16 @@ pub struct Foo {
}
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
}
extern "C" {
#[link_name = "_ZN3Foo4typeEv"]
@@ -30,51 +36,50 @@ extern "C" {
pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char);
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Foo {
#[inline]
pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 7u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
unsafe { ::std::mem::transmute(val as u8) }
}
#[inline]
- pub fn set_type__bindgen_bitfield(&mut self,
- val: ::std::os::raw::c_char) {
+ pub fn set_type__bindgen_bitfield(&mut self, val: ::std::os::raw::c_char) {
let mask = 7u64 as u8;
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(type__bindgen_bitfield: ::std::os::raw::c_char)
- -> u8 {
- ({ 0 } |
- ((type__bindgen_bitfield as u8 as u8) << 0usize) & (7u64 as u8))
+ pub fn new_bitfield_1(type__bindgen_bitfield: ::std::os::raw::c_char) -> u8 {
+ (0 | ((type__bindgen_bitfield as u8 as u8) << 0usize) & (7u64 as u8))
}
#[inline]
pub unsafe fn type_(&mut self) -> ::std::os::raw::c_char {
diff --git a/tests/expectations/tests/bitfield_align.rs b/tests/expectations/tests/bitfield_align.rs
index e2db1329..6479bb50 100644
--- a/tests/expectations/tests/bitfield_align.rs
+++ b/tests/expectations/tests/bitfield_align.rs
@@ -14,32 +14,42 @@ pub struct A {
}
#[test]
fn bindgen_test_layout_A() {
- assert_eq!(::std::mem::size_of::<A>() , 4usize , concat ! (
- "Size of: " , stringify ! ( A ) ));
- assert_eq! (::std::mem::align_of::<A>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( A ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const A ) ) . x as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( A ) , "::" , stringify
- ! ( x ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const A ) ) . y as * const _ as usize
- } , 3usize , concat ! (
- "Alignment of field: " , stringify ! ( A ) , "::" , stringify
- ! ( y ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A>(),
+ 4usize,
+ concat!("Size of: ", stringify!(A))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(A))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A)).x as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(A), "::", stringify!(x))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A)).y as *const _ as usize },
+ 3usize,
+ concat!("Alignment of field: ", stringify!(A), "::", stringify!(y))
+ );
}
impl Clone for A {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl A {
#[inline]
pub fn b1(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 1u64 as u16;
let val = (unit_field_val & mask) >> 0usize;
@@ -51,31 +61,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b2(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 2u64 as u16;
let val = (unit_field_val & mask) >> 1usize;
@@ -87,31 +97,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b3(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 4u64 as u16;
let val = (unit_field_val & mask) >> 2usize;
@@ -123,31 +133,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b4(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 8u64 as u16;
let val = (unit_field_val & mask) >> 3usize;
@@ -159,31 +169,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b5(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 16u64 as u16;
let val = (unit_field_val & mask) >> 4usize;
@@ -195,31 +205,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b6(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 32u64 as u16;
let val = (unit_field_val & mask) >> 5usize;
@@ -231,31 +241,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 5usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b7(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 64u64 as u16;
let val = (unit_field_val & mask) >> 6usize;
@@ -267,31 +277,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b8(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 128u64 as u16;
let val = (unit_field_val & mask) >> 7usize;
@@ -303,31 +313,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b9(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 256u64 as u16;
let val = (unit_field_val & mask) >> 8usize;
@@ -339,31 +349,31 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn b10(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 512u64 as u16;
let val = (unit_field_val & mask) >> 9usize;
@@ -375,66 +385,45 @@ impl A {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 9usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(b1: ::std::os::raw::c_uint,
- b2: ::std::os::raw::c_uint,
- b3: ::std::os::raw::c_uint,
- b4: ::std::os::raw::c_uint,
- b5: ::std::os::raw::c_uint,
- b6: ::std::os::raw::c_uint,
- b7: ::std::os::raw::c_uint,
- b8: ::std::os::raw::c_uint,
- b9: ::std::os::raw::c_uint,
- b10: ::std::os::raw::c_uint) -> u16 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((b1 as u32 as u16)
- << 0usize) &
- (1u64 as u16))
- } |
- ((b2 as u32 as u16) <<
- 1usize) &
- (2u64 as u16))
- } |
- ((b3 as u32 as u16) << 2usize)
- & (4u64 as u16))
- } |
- ((b4 as u32 as u16) << 3usize) &
- (8u64 as u16))
- } |
- ((b5 as u32 as u16) << 4usize) &
- (16u64 as u16))
- } |
- ((b6 as u32 as u16) << 5usize) &
- (32u64 as u16))
- } | ((b7 as u32 as u16) << 6usize) & (64u64 as u16))
- } | ((b8 as u32 as u16) << 7usize) & (128u64 as u16))
- } | ((b9 as u32 as u16) << 8usize) & (256u64 as u16))
- } | ((b10 as u32 as u16) << 9usize) & (512u64 as u16))
+ pub fn new_bitfield_1(
+ b1: ::std::os::raw::c_uint,
+ b2: ::std::os::raw::c_uint,
+ b3: ::std::os::raw::c_uint,
+ b4: ::std::os::raw::c_uint,
+ b5: ::std::os::raw::c_uint,
+ b6: ::std::os::raw::c_uint,
+ b7: ::std::os::raw::c_uint,
+ b8: ::std::os::raw::c_uint,
+ b9: ::std::os::raw::c_uint,
+ b10: ::std::os::raw::c_uint,
+ ) -> u16 {
+ ((((((((((0 | ((b1 as u32 as u16) << 0usize) & (1u64 as u16)) |
+ ((b2 as u32 as u16) << 1usize) & (2u64 as u16)) |
+ ((b3 as u32 as u16) << 2usize) & (4u64 as u16)) |
+ ((b4 as u32 as u16) << 3usize) & (8u64 as u16)) |
+ ((b5 as u32 as u16) << 4usize) & (16u64 as u16)) |
+ ((b6 as u32 as u16) << 5usize) & (32u64 as u16)) |
+ ((b7 as u32 as u16) << 6usize) & (64u64 as u16)) |
+ ((b8 as u32 as u16) << 7usize) & (128u64 as u16)) |
+ ((b9 as u32 as u16) << 8usize) & (256u64 as u16)) |
+ ((b10 as u32 as u16) << 9usize) & (512u64 as u16))
}
}
#[repr(C)]
@@ -445,24 +434,32 @@ pub struct B {
}
#[test]
fn bindgen_test_layout_B() {
- assert_eq!(::std::mem::size_of::<B>() , 4usize , concat ! (
- "Size of: " , stringify ! ( B ) ));
- assert_eq! (::std::mem::align_of::<B>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( B ) ));
+ assert_eq!(
+ ::std::mem::size_of::<B>(),
+ 4usize,
+ concat!("Size of: ", stringify!(B))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<B>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(B))
+ );
}
impl Clone for B {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl B {
#[inline]
pub fn foo(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 2147483647u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -474,31 +471,31 @@ impl B {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn bar(&self) -> ::std::os::raw::c_uchar {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 2147483648u64 as u32;
let val = (unit_field_val & mask) >> 31usize;
@@ -510,29 +507,26 @@ impl B {
let val = val as u8 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 31usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(foo: ::std::os::raw::c_uint,
- bar: ::std::os::raw::c_uchar) -> u32 {
- ({
- ({ 0 } |
- ((foo as u32 as u32) << 0usize) & (2147483647u64 as u32))
- } | ((bar as u8 as u32) << 31usize) & (2147483648u64 as u32))
+ pub fn new_bitfield_1(foo: ::std::os::raw::c_uint, bar: ::std::os::raw::c_uchar) -> u32 {
+ ((0 | ((foo as u32 as u32) << 0usize) & (2147483647u64 as u32)) |
+ ((bar as u8 as u32) << 31usize) & (2147483648u64 as u32))
}
}
#[repr(C)]
@@ -544,33 +538,42 @@ pub struct C {
}
#[test]
fn bindgen_test_layout_C() {
- assert_eq!(::std::mem::size_of::<C>() , 8usize , concat ! (
- "Size of: " , stringify ! ( C ) ));
- assert_eq! (::std::mem::align_of::<C>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( C ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const C ) ) . x as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( x ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( baz ) ));
+ assert_eq!(
+ ::std::mem::size_of::<C>(),
+ 8usize,
+ concat!("Size of: ", stringify!(C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<C>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(C))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).x as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(C), "::", stringify!(x))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).baz as *const _ as usize },
+ 4usize,
+ concat!("Alignment of field: ", stringify!(C), "::", stringify!(baz))
+ );
}
impl Clone for C {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl C {
#[inline]
pub fn b1(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -582,31 +585,31 @@ impl C {
let val = val as u32 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn b2(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 2u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -618,27 +621,26 @@ impl C {
let val = val as u32 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(b1: ::std::os::raw::c_uint,
- b2: ::std::os::raw::c_uint) -> u8 {
- ({ ({ 0 } | ((b1 as u32 as u8) << 0usize) & (1u64 as u8)) } |
- ((b2 as u32 as u8) << 1usize) & (2u64 as u8))
+ pub fn new_bitfield_1(b1: ::std::os::raw::c_uint, b2: ::std::os::raw::c_uint) -> u8 {
+ ((0 | ((b1 as u32 as u8) << 0usize) & (1u64 as u8)) |
+ ((b2 as u32 as u8) << 1usize) & (2u64 as u8))
}
}
#[repr(C)]
@@ -650,24 +652,32 @@ pub struct Date1 {
}
#[test]
fn bindgen_test_layout_Date1() {
- assert_eq!(::std::mem::size_of::<Date1>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Date1 ) ));
- assert_eq! (::std::mem::align_of::<Date1>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( Date1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Date1>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Date1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Date1>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(Date1))
+ );
}
impl Clone for Date1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Date1 {
#[inline]
pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 7u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -679,31 +689,31 @@ impl Date1 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 504u64 as u32;
let val = (unit_field_val & mask) >> 3usize;
@@ -715,31 +725,31 @@ impl Date1 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonth(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15872u64 as u32;
let val = (unit_field_val & mask) >> 9usize;
@@ -751,31 +761,31 @@ impl Date1 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 9usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nYear(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 16711680u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -787,38 +797,33 @@ impl Date1 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(nWeekDay: ::std::os::raw::c_ushort,
- nMonthDay: ::std::os::raw::c_ushort,
- nMonth: ::std::os::raw::c_ushort,
- nYear: ::std::os::raw::c_ushort) -> u32 {
- ({
- ({
- ({
- ({ 0 } |
- ((nWeekDay as u16 as u32) << 0usize) &
- (7u64 as u32))
- } |
- ((nMonthDay as u16 as u32) << 3usize) &
- (504u64 as u32))
- } | ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32))
- } | ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32))
+ pub fn new_bitfield_1(
+ nWeekDay: ::std::os::raw::c_ushort,
+ nMonthDay: ::std::os::raw::c_ushort,
+ nMonth: ::std::os::raw::c_ushort,
+ nYear: ::std::os::raw::c_ushort,
+ ) -> u32 {
+ ((((0 | ((nWeekDay as u16 as u32) << 0usize) & (7u64 as u32)) |
+ ((nMonthDay as u16 as u32) << 3usize) & (504u64 as u32)) |
+ ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32)) |
+ ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32))
}
}
#[repr(C)]
@@ -829,24 +834,32 @@ pub struct Date2 {
}
#[test]
fn bindgen_test_layout_Date2() {
- assert_eq!(::std::mem::size_of::<Date2>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Date2 ) ));
- assert_eq! (::std::mem::align_of::<Date2>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( Date2 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Date2>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Date2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Date2>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(Date2))
+ );
}
impl Clone for Date2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Date2 {
#[inline]
pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 7u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -858,31 +871,31 @@ impl Date2 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 504u64 as u32;
let val = (unit_field_val & mask) >> 3usize;
@@ -894,31 +907,31 @@ impl Date2 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonth(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15872u64 as u32;
let val = (unit_field_val & mask) >> 9usize;
@@ -930,31 +943,31 @@ impl Date2 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 9usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nYear(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 16711680u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -966,31 +979,31 @@ impl Date2 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn byte(&self) -> ::std::os::raw::c_uchar {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 4278190080u64 as u32;
let val = (unit_field_val & mask) >> 24usize;
@@ -1002,41 +1015,35 @@ impl Date2 {
let val = val as u8 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(nWeekDay: ::std::os::raw::c_ushort,
- nMonthDay: ::std::os::raw::c_ushort,
- nMonth: ::std::os::raw::c_ushort,
- nYear: ::std::os::raw::c_ushort,
- byte: ::std::os::raw::c_uchar) -> u32 {
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((nWeekDay as u16 as u32) << 0usize) &
- (7u64 as u32))
- } |
- ((nMonthDay as u16 as u32) << 3usize) &
- (504u64 as u32))
- } | ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32))
- } | ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32))
- } | ((byte as u8 as u32) << 24usize) & (4278190080u64 as u32))
+ pub fn new_bitfield_1(
+ nWeekDay: ::std::os::raw::c_ushort,
+ nMonthDay: ::std::os::raw::c_ushort,
+ nMonth: ::std::os::raw::c_ushort,
+ nYear: ::std::os::raw::c_ushort,
+ byte: ::std::os::raw::c_uchar,
+ ) -> u32 {
+ (((((0 | ((nWeekDay as u16 as u32) << 0usize) & (7u64 as u32)) |
+ ((nMonthDay as u16 as u32) << 3usize) & (504u64 as u32)) |
+ ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32)) |
+ ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32)) |
+ ((byte as u8 as u32) << 24usize) & (4278190080u64 as u32))
}
}
#[repr(C)]
@@ -1048,29 +1055,42 @@ pub struct Date3 {
}
#[test]
fn bindgen_test_layout_Date3() {
- assert_eq!(::std::mem::size_of::<Date3>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Date3 ) ));
- assert_eq! (::std::mem::align_of::<Date3>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( Date3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Date3 ) ) . byte as * const _ as usize }
- , 3usize , concat ! (
- "Alignment of field: " , stringify ! ( Date3 ) , "::" ,
- stringify ! ( byte ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Date3>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Date3))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Date3>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(Date3))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Date3)).byte as *const _ as usize },
+ 3usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Date3),
+ "::",
+ stringify!(byte)
+ )
+ );
}
impl Clone for Date3 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Date3 {
#[inline]
pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 7u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -1082,31 +1102,31 @@ impl Date3 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 504u64 as u32;
let val = (unit_field_val & mask) >> 3usize;
@@ -1118,31 +1138,31 @@ impl Date3 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nMonth(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15872u64 as u32;
let val = (unit_field_val & mask) >> 9usize;
@@ -1154,31 +1174,31 @@ impl Date3 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 9usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn nYear(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 16711680u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -1190,37 +1210,32 @@ impl Date3 {
let val = val as u16 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(nWeekDay: ::std::os::raw::c_ushort,
- nMonthDay: ::std::os::raw::c_ushort,
- nMonth: ::std::os::raw::c_ushort,
- nYear: ::std::os::raw::c_ushort) -> u32 {
- ({
- ({
- ({
- ({ 0 } |
- ((nWeekDay as u16 as u32) << 0usize) &
- (7u64 as u32))
- } |
- ((nMonthDay as u16 as u32) << 3usize) &
- (504u64 as u32))
- } | ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32))
- } | ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32))
+ pub fn new_bitfield_1(
+ nWeekDay: ::std::os::raw::c_ushort,
+ nMonthDay: ::std::os::raw::c_ushort,
+ nMonth: ::std::os::raw::c_ushort,
+ nYear: ::std::os::raw::c_ushort,
+ ) -> u32 {
+ ((((0 | ((nWeekDay as u16 as u32) << 0usize) & (7u64 as u32)) |
+ ((nMonthDay as u16 as u32) << 3usize) & (504u64 as u32)) |
+ ((nMonth as u16 as u32) << 9usize) & (15872u64 as u32)) |
+ ((nYear as u16 as u32) << 16usize) & (16711680u64 as u32))
}
}
diff --git a/tests/expectations/tests/bitfield_align_2.rs b/tests/expectations/tests/bitfield_align_2.rs
index f92f09db..d3ce64f8 100644
--- a/tests/expectations/tests/bitfield_align_2.rs
+++ b/tests/expectations/tests/bitfield_align_2.rs
@@ -6,7 +6,12 @@
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum MyEnum { ONE = 0, TWO = 1, THREE = 2, FOUR = 3, }
+pub enum MyEnum {
+ ONE = 0,
+ TWO = 1,
+ THREE = 2,
+ FOUR = 3,
+}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct TaggedPtr {
@@ -15,27 +20,37 @@ pub struct TaggedPtr {
}
#[test]
fn bindgen_test_layout_TaggedPtr() {
- assert_eq!(::std::mem::size_of::<TaggedPtr>() , 8usize , concat ! (
- "Size of: " , stringify ! ( TaggedPtr ) ));
- assert_eq! (::std::mem::align_of::<TaggedPtr>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( TaggedPtr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<TaggedPtr>(),
+ 8usize,
+ concat!("Size of: ", stringify!(TaggedPtr))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<TaggedPtr>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(TaggedPtr))
+ );
}
impl Clone for TaggedPtr {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for TaggedPtr {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl TaggedPtr {
#[inline]
pub fn tag(&self) -> MyEnum {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 3u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -47,31 +62,31 @@ impl TaggedPtr {
let val = val as u32 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn ptr(&self) -> ::std::os::raw::c_long {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 18446744073709551612u64 as u64;
let val = (unit_field_val & mask) >> 2usize;
@@ -83,26 +98,25 @@ impl TaggedPtr {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn new_bitfield_1(tag: MyEnum, ptr: ::std::os::raw::c_long) -> u64 {
- ({ ({ 0 } | ((tag as u32 as u64) << 0usize) & (3u64 as u64)) } |
- ((ptr as u64 as u64) << 2usize) &
- (18446744073709551612u64 as u64))
+ ((0 | ((tag as u32 as u64) << 0usize) & (3u64 as u64)) |
+ ((ptr as u64 as u64) << 2usize) & (18446744073709551612u64 as u64))
}
}
diff --git a/tests/expectations/tests/bitfield_method_mangling.rs b/tests/expectations/tests/bitfield_method_mangling.rs
index 855ae72b..736d6360 100644
--- a/tests/expectations/tests/bitfield_method_mangling.rs
+++ b/tests/expectations/tests/bitfield_method_mangling.rs
@@ -12,27 +12,32 @@ pub struct mach_msg_type_descriptor_t {
}
#[test]
fn bindgen_test_layout_mach_msg_type_descriptor_t() {
- assert_eq!(::std::mem::size_of::<mach_msg_type_descriptor_t>() , 4usize ,
- concat ! (
- "Size of: " , stringify ! ( mach_msg_type_descriptor_t ) ));
- assert_eq! (::std::mem::align_of::<mach_msg_type_descriptor_t>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( mach_msg_type_descriptor_t )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<mach_msg_type_descriptor_t>(),
+ 4usize,
+ concat!("Size of: ", stringify!(mach_msg_type_descriptor_t))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<mach_msg_type_descriptor_t>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(mach_msg_type_descriptor_t))
+ );
}
impl Clone for mach_msg_type_descriptor_t {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl mach_msg_type_descriptor_t {
#[inline]
pub fn pad3(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 16777215u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -44,31 +49,31 @@ impl mach_msg_type_descriptor_t {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn type_(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 4278190080u64 as u32;
let val = (unit_field_val & mask) >> 24usize;
@@ -80,26 +85,25 @@ impl mach_msg_type_descriptor_t {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(pad3: ::std::os::raw::c_uint,
- type_: ::std::os::raw::c_uint) -> u32 {
- ({ ({ 0 } | ((pad3 as u32 as u32) << 0usize) & (16777215u64 as u32)) }
- | ((type_ as u32 as u32) << 24usize) & (4278190080u64 as u32))
+ pub fn new_bitfield_1(pad3: ::std::os::raw::c_uint, type_: ::std::os::raw::c_uint) -> u32 {
+ ((0 | ((pad3 as u32 as u32) << 0usize) & (16777215u64 as u32)) |
+ ((type_ as u32 as u32) << 24usize) & (4278190080u64 as u32))
}
}
diff --git a/tests/expectations/tests/blacklist-and-impl-debug.rs b/tests/expectations/tests/blacklist-and-impl-debug.rs
index d84b0256..3cba2b29 100644
--- a/tests/expectations/tests/blacklist-and-impl-debug.rs
+++ b/tests/expectations/tests/blacklist-and-impl-debug.rs
@@ -5,6 +5,7 @@
pub struct BlacklistMe(u8);
+
/// Because this type contains a blacklisted type, it should not derive Debug.
#[repr(C)]
pub struct ShouldManuallyImplDebug {
@@ -12,23 +13,34 @@ pub struct ShouldManuallyImplDebug {
}
#[test]
fn bindgen_test_layout_ShouldManuallyImplDebug() {
- assert_eq!(::std::mem::size_of::<ShouldManuallyImplDebug>() , 1usize ,
- concat ! (
- "Size of: " , stringify ! ( ShouldManuallyImplDebug ) ));
- assert_eq! (::std::mem::align_of::<ShouldManuallyImplDebug>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( ShouldManuallyImplDebug ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldManuallyImplDebug ) ) . a as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ShouldManuallyImplDebug
- ) , "::" , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldManuallyImplDebug>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ShouldManuallyImplDebug))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ShouldManuallyImplDebug>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ShouldManuallyImplDebug))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldManuallyImplDebug)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldManuallyImplDebug),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for ShouldManuallyImplDebug {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl ::std::fmt::Debug for ShouldManuallyImplDebug {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- write!(f , "ShouldManuallyImplDebug {{ }}")
+ write!(f, "ShouldManuallyImplDebug {{ }}")
}
}
diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs
index a874d6b8..b0062c9b 100644
--- a/tests/expectations/tests/class_nested.rs
+++ b/tests/expectations/tests/class_nested.rs
@@ -16,18 +16,31 @@ pub struct A_B {
}
#[test]
fn bindgen_test_layout_A_B() {
- assert_eq!(::std::mem::size_of::<A_B>() , 4usize , concat ! (
- "Size of: " , stringify ! ( A_B ) ));
- assert_eq! (::std::mem::align_of::<A_B>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( A_B ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const A_B ) ) . member_b as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( A_B ) , "::" ,
- stringify ! ( member_b ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A_B>(),
+ 4usize,
+ concat!("Size of: ", stringify!(A_B))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A_B>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(A_B))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A_B)).member_b as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(A_B),
+ "::",
+ stringify!(member_b)
+ )
+ );
}
impl Clone for A_B {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -35,23 +48,38 @@ pub struct A_D<T> {
pub foo: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for A_D<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for A_D<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_A() {
- assert_eq!(::std::mem::size_of::<A>() , 4usize , concat ! (
- "Size of: " , stringify ! ( A ) ));
- assert_eq! (::std::mem::align_of::<A>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( A ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const A ) ) . member_a as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( A ) , "::" , stringify
- ! ( member_a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A>(),
+ 4usize,
+ concat!("Size of: ", stringify!(A))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(A))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A)).member_a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(A),
+ "::",
+ stringify!(member_a)
+ )
+ );
}
impl Clone for A {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -60,18 +88,31 @@ pub struct A_C {
}
#[test]
fn bindgen_test_layout_A_C() {
- assert_eq!(::std::mem::size_of::<A_C>() , 4usize , concat ! (
- "Size of: " , stringify ! ( A_C ) ));
- assert_eq! (::std::mem::align_of::<A_C>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( A_C ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const A_C ) ) . baz as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( A_C ) , "::" ,
- stringify ! ( baz ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A_C>(),
+ 4usize,
+ concat!("Size of: ", stringify!(A_C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A_C>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(A_C))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A_C)).baz as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(A_C),
+ "::",
+ stringify!(baz)
+ )
+ );
}
impl Clone for A_C {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
extern "C" {
#[link_name = "var"]
@@ -79,14 +120,15 @@ extern "C" {
}
#[test]
fn __bindgen_test_layout_A_D_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<A_D<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- A_D<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<A_D<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- A_D<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A_D<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( A_D < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < A_D < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( A_D < :: std :: os :: raw :: c_int > ) ) );
}
extern "C" {
#[link_name = "baz"]
@@ -99,18 +141,14 @@ pub struct D {
}
#[test]
fn bindgen_test_layout_D() {
- assert_eq!(::std::mem::size_of::<D>() , 4usize , concat ! (
- "Size of: " , stringify ! ( D ) ));
- assert_eq! (::std::mem::align_of::<D>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( D ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const D ) ) . member as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( D ) , "::" , stringify
- ! ( member ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < D > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( D ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < D > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( D ) ) );
+ assert_eq ! ( unsafe { & ( * ( 0 as * const D ) ) . member as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( D ) , "::" , stringify ! ( member ) ) );
}
impl Clone for D {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -124,9 +162,13 @@ pub struct Templated_Templated_inner<T> {
pub member_ptr: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for Templated_Templated_inner<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Templated_Templated_inner<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
-impl <T> Default for Templated<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Templated<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/class_use_as.rs b/tests/expectations/tests/class_use_as.rs
index 4d2ae275..af73ae3b 100644
--- a/tests/expectations/tests/class_use_as.rs
+++ b/tests/expectations/tests/class_use_as.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen="true" replaces="whatever"></div>
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -12,18 +13,31 @@ pub struct whatever {
}
#[test]
fn bindgen_test_layout_whatever() {
- assert_eq!(::std::mem::size_of::<whatever>() , 4usize , concat ! (
- "Size of: " , stringify ! ( whatever ) ));
- assert_eq! (::std::mem::align_of::<whatever>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( whatever ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const whatever ) ) . replacement as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( whatever ) , "::" ,
- stringify ! ( replacement ) ));
+ assert_eq!(
+ ::std::mem::size_of::<whatever>(),
+ 4usize,
+ concat!("Size of: ", stringify!(whatever))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<whatever>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(whatever))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const whatever)).replacement as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(whatever),
+ "::",
+ stringify!(replacement)
+ )
+ );
}
impl Clone for whatever {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -32,16 +46,29 @@ pub struct container {
}
#[test]
fn bindgen_test_layout_container() {
- assert_eq!(::std::mem::size_of::<container>() , 4usize , concat ! (
- "Size of: " , stringify ! ( container ) ));
- assert_eq! (::std::mem::align_of::<container>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( container ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const container ) ) . c as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( container ) , "::" ,
- stringify ! ( c ) ));
+ assert_eq!(
+ ::std::mem::size_of::<container>(),
+ 4usize,
+ concat!("Size of: ", stringify!(container))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<container>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(container))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const container)).c as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(container),
+ "::",
+ stringify!(c)
+ )
+ );
}
impl Clone for container {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs
index 8171288a..08e3aa88 100644
--- a/tests/expectations/tests/class_with_dtor.rs
+++ b/tests/expectations/tests/class_with_dtor.rs
@@ -10,8 +10,10 @@ pub struct HandleWithDtor<T> {
pub ptr: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for HandleWithDtor<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for HandleWithDtor<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub type HandleValue = HandleWithDtor<::std::os::raw::c_int>;
#[repr(C)]
@@ -21,27 +23,41 @@ pub struct WithoutDtor {
}
#[test]
fn bindgen_test_layout_WithoutDtor() {
- assert_eq!(::std::mem::size_of::<WithoutDtor>() , 8usize , concat ! (
- "Size of: " , stringify ! ( WithoutDtor ) ));
- assert_eq! (::std::mem::align_of::<WithoutDtor>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( WithoutDtor ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithoutDtor ) ) . shouldBeWithDtor as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithoutDtor ) , "::" ,
- stringify ! ( shouldBeWithDtor ) ));
+ assert_eq!(
+ ::std::mem::size_of::<WithoutDtor>(),
+ 8usize,
+ concat!("Size of: ", stringify!(WithoutDtor))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<WithoutDtor>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(WithoutDtor))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WithoutDtor)).shouldBeWithDtor as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WithoutDtor),
+ "::",
+ stringify!(shouldBeWithDtor)
+ )
+ );
}
impl Default for WithoutDtor {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>()
- , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- HandleWithDtor<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>()
- , 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- HandleWithDtor<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>(),
+ 8usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( HandleWithDtor < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < HandleWithDtor < :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( HandleWithDtor < :: std :: os :: raw :: c_int > ) ) );
}
diff --git a/tests/expectations/tests/constify-all-enums.rs b/tests/expectations/tests/constify-all-enums.rs
index 700ddeb4..af13e079 100644
--- a/tests/expectations/tests/constify-all-enums.rs
+++ b/tests/expectations/tests/constify-all-enums.rs
@@ -15,19 +15,34 @@ pub struct bar {
}
#[test]
fn bindgen_test_layout_bar() {
- assert_eq!(::std::mem::size_of::<bar>() , 4usize , concat ! (
- "Size of: " , stringify ! ( bar ) ));
- assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . this_should_work as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( this_should_work ) ));
+ assert_eq!(
+ ::std::mem::size_of::<bar>(),
+ 4usize,
+ concat!("Size of: ", stringify!(bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<bar>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(this_should_work)
+ )
+ );
}
impl Clone for bar {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for bar {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/constify-module-enums-basic.rs b/tests/expectations/tests/constify-module-enums-basic.rs
index 803c804b..bfe33c6b 100644
--- a/tests/expectations/tests/constify-module-enums-basic.rs
+++ b/tests/expectations/tests/constify-module-enums-basic.rs
@@ -19,27 +19,48 @@ pub struct bar {
}
#[test]
fn bindgen_test_layout_bar() {
- assert_eq!(::std::mem::size_of::<bar>() , 4usize , concat ! (
- "Size of: " , stringify ! ( bar ) ));
- assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . this_should_work as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( this_should_work ) ));
+ assert_eq!(
+ ::std::mem::size_of::<bar>(),
+ 4usize,
+ concat!("Size of: ", stringify!(bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<bar>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).this_should_work as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(this_should_work)
+ )
+ );
}
impl Clone for bar {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for bar {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "C" {
- pub fn func1(arg1: foo::Type, arg2: *mut foo::Type,
- arg3: *mut *mut foo::Type) -> *mut foo::Type;
+ pub fn func1(
+ arg1: foo::Type,
+ arg2: *mut foo::Type,
+ arg3: *mut *mut foo::Type,
+ ) -> *mut foo::Type;
}
extern "C" {
- pub fn func2(arg1: foo_alias1, arg2: *mut foo_alias1,
- arg3: *mut *mut foo_alias1) -> *mut foo_alias1;
+ pub fn func2(
+ arg1: foo_alias1,
+ arg2: *mut foo_alias1,
+ arg3: *mut *mut foo_alias1,
+ ) -> *mut foo_alias1;
}
diff --git a/tests/expectations/tests/constify-module-enums-simple-alias.rs b/tests/expectations/tests/constify-module-enums-simple-alias.rs
index 709a6947..75c952d7 100644
--- a/tests/expectations/tests/constify-module-enums-simple-alias.rs
+++ b/tests/expectations/tests/constify-module-enums-simple-alias.rs
@@ -27,54 +27,104 @@ pub struct Bar {
}
#[test]
fn bindgen_test_layout_Bar() {
- assert_eq!(::std::mem::size_of::<Bar>() , 48usize , concat ! (
- "Size of: " , stringify ! ( Bar ) ));
- assert_eq! (::std::mem::align_of::<Bar>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( Bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz1 as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz2 as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz3 as * const _ as usize } ,
- 8usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz4 as * const _ as usize } ,
- 12usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz_ptr1 as * const _ as usize
- } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz_ptr1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz_ptr2 as * const _ as usize
- } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz_ptr2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz_ptr3 as * const _ as usize
- } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz_ptr3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . baz_ptr4 as * const _ as usize
- } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( baz_ptr4 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Bar>(),
+ 48usize,
+ concat!("Size of: ", stringify!(Bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Bar>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(Bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz1 as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz2 as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz2)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz3 as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz3)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz4 as *const _ as usize },
+ 12usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz4)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz_ptr1 as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz_ptr1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz_ptr2 as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz_ptr2)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz_ptr3 as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz_ptr3)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).baz_ptr4 as *const _ as usize },
+ 40usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(baz_ptr4)
+ )
+ );
}
impl Clone for Bar {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for Bar {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/default-template-parameter.rs b/tests/expectations/tests/default-template-parameter.rs
index 0336f0d8..8dae0c90 100644
--- a/tests/expectations/tests/default-template-parameter.rs
+++ b/tests/expectations/tests/default-template-parameter.rs
@@ -12,19 +12,29 @@ pub struct Foo<T, U> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
}
-impl <T, U> Default for Foo<T, U> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T, U> Default for Foo<T, U> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_Foo_open0_bool__int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<Foo<bool, ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- Foo<bool, ::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<Foo<bool, ::std::os::raw::c_int>>() ,
- 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- Foo<bool, ::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo<bool, ::std::os::raw::c_int>>(),
+ 8usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( Foo < bool , :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo<bool, ::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Alignment of template specialization: ",
+ stringify ! ( Foo < bool , :: std :: os :: raw :: c_int > )
+ )
+ );
}
extern "C" {
#[link_name = "_ZL3bar"]
diff --git a/tests/expectations/tests/derive-debug-bitfield.rs b/tests/expectations/tests/derive-debug-bitfield.rs
index 62e941e4..47ec570b 100644
--- a/tests/expectations/tests/derive-debug-bitfield.rs
+++ b/tests/expectations/tests/derive-debug-bitfield.rs
@@ -12,30 +12,50 @@ pub struct C {
}
#[test]
fn bindgen_test_layout_C() {
- assert_eq!(::std::mem::size_of::<C>() , 204usize , concat ! (
- "Size of: " , stringify ! ( C ) ));
- assert_eq! (::std::mem::align_of::<C>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( C ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . large_array as * const _ as usize
- } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( large_array ) ));
+ assert_eq!(
+ ::std::mem::size_of::<C>(),
+ 204usize,
+ concat!("Size of: ", stringify!(C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<C>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(C))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).large_array as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(large_array)
+ )
+ );
}
impl Clone for C {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for C {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl ::std::fmt::Debug for C {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- write!(f , "C {{ a : {:?}, b : {:?}, large_array: [{}] }}" , self . a
- ( ) , self . b ( ) , self . large_array . iter ( ) .
- enumerate ( ) . map (
- | ( i , v ) | format ! (
- "{}{:?}" , if i > 0 { ", " } else { "" } , v ) ) . collect :: <
- String > ( ))
+ write!(
+ f,
+ "C {{ a : {:?}, b : {:?}, large_array: [{}] }}",
+ self.a(),
+ self.b(),
+ self.large_array
+ .iter()
+ .enumerate()
+ .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v))
+ .collect::<String>()
+ )
}
}
impl C {
@@ -43,11 +63,11 @@ impl C {
pub fn a(&self) -> bool {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -59,31 +79,31 @@ impl C {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn b(&self) -> bool {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 254u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -95,25 +115,25 @@ impl C {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn new_bitfield_1(a: bool, b: bool) -> u8 {
- ({ ({ 0 } | ((a as u8 as u8) << 0usize) & (1u64 as u8)) } |
- ((b as u8 as u8) << 1usize) & (254u64 as u8))
+ ((0 | ((a as u8 as u8) << 0usize) & (1u64 as u8)) |
+ ((b as u8 as u8) << 1usize) & (254u64 as u8))
}
}
diff --git a/tests/expectations/tests/derive-debug-generic.rs b/tests/expectations/tests/derive-debug-generic.rs
index f238234a..6c0b41a6 100644
--- a/tests/expectations/tests/derive-debug-generic.rs
+++ b/tests/expectations/tests/derive-debug-generic.rs
@@ -9,11 +9,13 @@ pub struct Generic<T> {
pub t: [T; 40usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for Generic<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Generic<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
-impl <T> ::std::fmt::Debug for Generic<T> {
+impl<T> ::std::fmt::Debug for Generic<T> {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- write!(f , "Generic {{ t: Array with length 40 }}")
+ write!(f, "Generic {{ t: Array with length 40 }}")
}
}
diff --git a/tests/expectations/tests/derive-default-and-blacklist.rs b/tests/expectations/tests/derive-default-and-blacklist.rs
index e811bd05..d6a8bc75 100644
--- a/tests/expectations/tests/derive-default-and-blacklist.rs
+++ b/tests/expectations/tests/derive-default-and-blacklist.rs
@@ -5,6 +5,7 @@
pub struct BlacklistMe(u8);
+
/// Because this type contains a blacklisted type, it should not derive
/// Default. Instead, we should emit a `mem::zeroed` implementation.
#[repr(C)]
@@ -13,18 +14,29 @@ pub struct ShouldNotDeriveDefault {
}
#[test]
fn bindgen_test_layout_ShouldNotDeriveDefault() {
- assert_eq!(::std::mem::size_of::<ShouldNotDeriveDefault>() , 1usize ,
- concat ! ( "Size of: " , stringify ! ( ShouldNotDeriveDefault )
- ));
- assert_eq! (::std::mem::align_of::<ShouldNotDeriveDefault>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( ShouldNotDeriveDefault ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldNotDeriveDefault ) ) . a as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ShouldNotDeriveDefault
- ) , "::" , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldNotDeriveDefault>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ShouldNotDeriveDefault))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ShouldNotDeriveDefault>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ShouldNotDeriveDefault))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldNotDeriveDefault)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldNotDeriveDefault),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for ShouldNotDeriveDefault {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/derive-hash-and-blacklist.rs b/tests/expectations/tests/derive-hash-and-blacklist.rs
index e5a66376..bdbdc9ae 100644
--- a/tests/expectations/tests/derive-hash-and-blacklist.rs
+++ b/tests/expectations/tests/derive-hash-and-blacklist.rs
@@ -5,6 +5,7 @@
pub struct BlacklistMe(u8);
+
/// Because this type contains a blacklisted type, it should not derive Hash.
#[repr(C)]
pub struct ShouldNotDeriveHash {
@@ -12,17 +13,29 @@ pub struct ShouldNotDeriveHash {
}
#[test]
fn bindgen_test_layout_ShouldNotDeriveHash() {
- assert_eq!(::std::mem::size_of::<ShouldNotDeriveHash>() , 1usize , concat
- ! ( "Size of: " , stringify ! ( ShouldNotDeriveHash ) ));
- assert_eq! (::std::mem::align_of::<ShouldNotDeriveHash>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( ShouldNotDeriveHash ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldNotDeriveHash ) ) . a as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ShouldNotDeriveHash ) ,
- "::" , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldNotDeriveHash>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ShouldNotDeriveHash))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ShouldNotDeriveHash>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ShouldNotDeriveHash))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldNotDeriveHash)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldNotDeriveHash),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for ShouldNotDeriveHash {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/derive-hash-blacklisting.rs b/tests/expectations/tests/derive-hash-blacklisting.rs
index 5d1a8d37..c9cbf6ef 100644
--- a/tests/expectations/tests/derive-hash-blacklisting.rs
+++ b/tests/expectations/tests/derive-hash-blacklisting.rs
@@ -3,7 +3,13 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct Blacklisted<T> {t: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>> }
+#[repr(C)]
+#[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)]
+pub struct Blacklisted<T> {
+ t: T,
+ pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
+}
+
/// This would derive(Hash, Eq, PartialEq) if it didn't contain a blacklisted type,
/// causing us to conservatively avoid deriving hash/Eq/PartialEq for it.
@@ -13,18 +19,31 @@ pub struct WhitelistedOne {
}
#[test]
fn bindgen_test_layout_WhitelistedOne() {
- assert_eq!(::std::mem::size_of::<WhitelistedOne>() , 4usize , concat ! (
- "Size of: " , stringify ! ( WhitelistedOne ) ));
- assert_eq! (::std::mem::align_of::<WhitelistedOne>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( WhitelistedOne ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WhitelistedOne ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WhitelistedOne ) , "::"
- , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<WhitelistedOne>(),
+ 4usize,
+ concat!("Size of: ", stringify!(WhitelistedOne))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<WhitelistedOne>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(WhitelistedOne))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WhitelistedOne)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WhitelistedOne),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for WhitelistedOne {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// This can't derive(Hash/Eq) even if it didn't contain a blacklisted type.
#[repr(C)]
@@ -33,16 +52,29 @@ pub struct WhitelistedTwo {
}
#[test]
fn bindgen_test_layout_WhitelistedTwo() {
- assert_eq!(::std::mem::size_of::<WhitelistedTwo>() , 4usize , concat ! (
- "Size of: " , stringify ! ( WhitelistedTwo ) ));
- assert_eq! (::std::mem::align_of::<WhitelistedTwo>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( WhitelistedTwo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WhitelistedTwo ) ) . b as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WhitelistedTwo ) , "::"
- , stringify ! ( b ) ));
+ assert_eq!(
+ ::std::mem::size_of::<WhitelistedTwo>(),
+ 4usize,
+ concat!("Size of: ", stringify!(WhitelistedTwo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<WhitelistedTwo>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(WhitelistedTwo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WhitelistedTwo)).b as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WhitelistedTwo),
+ "::",
+ stringify!(b)
+ )
+ );
}
impl Default for WhitelistedTwo {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs b/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs
index 3457afef..332c1129 100644
--- a/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs
+++ b/tests/expectations/tests/derive-hash-struct-with-anon-struct-float.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// A struct containing a struct containing a float that cannot derive hash/eq but can derive partial eq.
#[repr(C)]
#[derive(Debug, Default, Copy, PartialEq)]
@@ -18,36 +19,67 @@ pub struct foo__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 8usize , concat !
- ( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( a ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo__bindgen_ty_1 ) ) . b as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( foo__bindgen_ty_1 ) ,
- "::" , stringify ! ( b ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo__bindgen_ty_1>(),
+ 8usize,
+ concat!("Size of: ", stringify!(foo__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo__bindgen_ty_1>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo__bindgen_ty_1)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(foo__bindgen_ty_1),
+ "::",
+ stringify!(a)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo__bindgen_ty_1)).b as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(foo__bindgen_ty_1),
+ "::",
+ stringify!(b)
+ )
+ );
}
impl Clone for foo__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_foo() {
- assert_eq!(::std::mem::size_of::<foo>() , 8usize , concat ! (
- "Size of: " , stringify ! ( foo ) ));
- assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo>(),
+ 8usize,
+ concat!("Size of: ", stringify!(foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(foo),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/derive-hash-struct-with-float-array.rs b/tests/expectations/tests/derive-hash-struct-with-float-array.rs
index 9ee6785c..43075796 100644
--- a/tests/expectations/tests/derive-hash-struct-with-float-array.rs
+++ b/tests/expectations/tests/derive-hash-struct-with-float-array.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// A struct containing an array of floats that cannot derive hash/eq but can derive partialeq.
#[repr(C)]
#[derive(Debug, Default, Copy, PartialEq)]
@@ -12,16 +13,29 @@ pub struct foo {
}
#[test]
fn bindgen_test_layout_foo() {
- assert_eq!(::std::mem::size_of::<foo>() , 12usize , concat ! (
- "Size of: " , stringify ! ( foo ) ));
- assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . bar as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo>(),
+ 12usize,
+ concat!("Size of: ", stringify!(foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(foo),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/derive-hash-struct-with-pointer.rs b/tests/expectations/tests/derive-hash-struct-with-pointer.rs
index c29f9b1e..28aa1e25 100644
--- a/tests/expectations/tests/derive-hash-struct-with-pointer.rs
+++ b/tests/expectations/tests/derive-hash-struct-with-pointer.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// Pointers can derive hash/PartialEq/Eq
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -12,21 +13,36 @@ pub struct ConstPtrMutObj {
}
#[test]
fn bindgen_test_layout_ConstPtrMutObj() {
- assert_eq!(::std::mem::size_of::<ConstPtrMutObj>() , 8usize , concat ! (
- "Size of: " , stringify ! ( ConstPtrMutObj ) ));
- assert_eq! (::std::mem::align_of::<ConstPtrMutObj>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( ConstPtrMutObj ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ConstPtrMutObj ) ) . bar as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ConstPtrMutObj ) , "::"
- , stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ConstPtrMutObj>(),
+ 8usize,
+ concat!("Size of: ", stringify!(ConstPtrMutObj))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ConstPtrMutObj>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(ConstPtrMutObj))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ConstPtrMutObj)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ConstPtrMutObj),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for ConstPtrMutObj {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for ConstPtrMutObj {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -35,21 +51,36 @@ pub struct MutPtrMutObj {
}
#[test]
fn bindgen_test_layout_MutPtrMutObj() {
- assert_eq!(::std::mem::size_of::<MutPtrMutObj>() , 8usize , concat ! (
- "Size of: " , stringify ! ( MutPtrMutObj ) ));
- assert_eq! (::std::mem::align_of::<MutPtrMutObj>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( MutPtrMutObj ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const MutPtrMutObj ) ) . bar as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( MutPtrMutObj ) , "::" ,
- stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<MutPtrMutObj>(),
+ 8usize,
+ concat!("Size of: ", stringify!(MutPtrMutObj))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<MutPtrMutObj>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(MutPtrMutObj))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const MutPtrMutObj)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(MutPtrMutObj),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for MutPtrMutObj {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for MutPtrMutObj {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -58,21 +89,36 @@ pub struct MutPtrConstObj {
}
#[test]
fn bindgen_test_layout_MutPtrConstObj() {
- assert_eq!(::std::mem::size_of::<MutPtrConstObj>() , 8usize , concat ! (
- "Size of: " , stringify ! ( MutPtrConstObj ) ));
- assert_eq! (::std::mem::align_of::<MutPtrConstObj>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( MutPtrConstObj ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const MutPtrConstObj ) ) . bar as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( MutPtrConstObj ) , "::"
- , stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<MutPtrConstObj>(),
+ 8usize,
+ concat!("Size of: ", stringify!(MutPtrConstObj))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<MutPtrConstObj>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(MutPtrConstObj))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const MutPtrConstObj)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(MutPtrConstObj),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for MutPtrConstObj {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for MutPtrConstObj {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -81,19 +127,34 @@ pub struct ConstPtrConstObj {
}
#[test]
fn bindgen_test_layout_ConstPtrConstObj() {
- assert_eq!(::std::mem::size_of::<ConstPtrConstObj>() , 8usize , concat ! (
- "Size of: " , stringify ! ( ConstPtrConstObj ) ));
- assert_eq! (::std::mem::align_of::<ConstPtrConstObj>() , 8usize , concat !
- ( "Alignment of " , stringify ! ( ConstPtrConstObj ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ConstPtrConstObj ) ) . bar as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ConstPtrConstObj ) ,
- "::" , stringify ! ( bar ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ConstPtrConstObj>(),
+ 8usize,
+ concat!("Size of: ", stringify!(ConstPtrConstObj))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ConstPtrConstObj>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(ConstPtrConstObj))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ConstPtrConstObj)).bar as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ConstPtrConstObj),
+ "::",
+ stringify!(bar)
+ )
+ );
}
impl Clone for ConstPtrConstObj {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for ConstPtrConstObj {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/derive-hash-template-def-float.rs b/tests/expectations/tests/derive-hash-template-def-float.rs
index 23bf702d..7b643901 100644
--- a/tests/expectations/tests/derive-hash-template-def-float.rs
+++ b/tests/expectations/tests/derive-hash-template-def-float.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// Template definition containing a float, which cannot derive hash/eq but can derive partialeq.
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
@@ -12,6 +13,8 @@ pub struct foo<T> {
pub b: f32,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for foo<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for foo<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/derive-hash-template-inst-float.rs b/tests/expectations/tests/derive-hash-template-inst-float.rs
index 58848f87..7bca45b3 100644
--- a/tests/expectations/tests/derive-hash-template-inst-float.rs
+++ b/tests/expectations/tests/derive-hash-template-inst-float.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// Template definition that doesn't contain float can derive hash/partialeq/eq
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -11,8 +12,10 @@ pub struct foo<T> {
pub data: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for foo<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for foo<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// Can derive hash/partialeq/eq when instantiated with int
#[repr(C)]
@@ -22,21 +25,36 @@ pub struct IntStr {
}
#[test]
fn bindgen_test_layout_IntStr() {
- assert_eq!(::std::mem::size_of::<IntStr>() , 4usize , concat ! (
- "Size of: " , stringify ! ( IntStr ) ));
- assert_eq! (::std::mem::align_of::<IntStr>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( IntStr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const IntStr ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( IntStr ) , "::" ,
- stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<IntStr>(),
+ 4usize,
+ concat!("Size of: ", stringify!(IntStr))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<IntStr>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(IntStr))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const IntStr)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(IntStr),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Clone for IntStr {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for IntStr {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// Cannot derive hash/eq when instantiated with float but can derive partialeq
#[repr(C)]
@@ -46,39 +64,51 @@ pub struct FloatStr {
}
#[test]
fn bindgen_test_layout_FloatStr() {
- assert_eq!(::std::mem::size_of::<FloatStr>() , 4usize , concat ! (
- "Size of: " , stringify ! ( FloatStr ) ));
- assert_eq! (::std::mem::align_of::<FloatStr>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( FloatStr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const FloatStr ) ) . a as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( FloatStr ) , "::" ,
- stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<FloatStr>(),
+ 4usize,
+ concat!("Size of: ", stringify!(FloatStr))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<FloatStr>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(FloatStr))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const FloatStr)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(FloatStr),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Clone for FloatStr {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for FloatStr {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_foo_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<foo<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- foo<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<foo<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- foo<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( foo < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < foo < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( foo < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_foo_open0_float_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<foo<f32>>() , 4usize , concat ! (
- "Size of template specialization: " , stringify ! ( foo<f32> )
- ));
- assert_eq!(::std::mem::align_of::<foo<f32>>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- foo<f32> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < foo < f32 > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( foo < f32 > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < foo < f32 > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( foo < f32 > ) ) );
}
diff --git a/tests/expectations/tests/derive-partialeq-and-blacklist.rs b/tests/expectations/tests/derive-partialeq-and-blacklist.rs
index 4aac3c8c..28f8ff53 100644
--- a/tests/expectations/tests/derive-partialeq-and-blacklist.rs
+++ b/tests/expectations/tests/derive-partialeq-and-blacklist.rs
@@ -5,6 +5,7 @@
pub struct BlacklistMe(u8);
+
/// Because this type contains a blacklisted type, it should not derive
/// PartialEq.
#[repr(C)]
@@ -13,18 +14,29 @@ pub struct ShouldNotDerivePartialEq {
}
#[test]
fn bindgen_test_layout_ShouldNotDerivePartialEq() {
- assert_eq!(::std::mem::size_of::<ShouldNotDerivePartialEq>() , 1usize ,
- concat ! (
- "Size of: " , stringify ! ( ShouldNotDerivePartialEq ) ));
- assert_eq! (::std::mem::align_of::<ShouldNotDerivePartialEq>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( ShouldNotDerivePartialEq ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldNotDerivePartialEq ) ) . a as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- ShouldNotDerivePartialEq ) , "::" , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldNotDerivePartialEq>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ShouldNotDerivePartialEq))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ShouldNotDerivePartialEq>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ShouldNotDerivePartialEq))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldNotDerivePartialEq)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldNotDerivePartialEq),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for ShouldNotDerivePartialEq {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs
index 069728cb..6b078418 100644
--- a/tests/expectations/tests/forward-declaration-autoptr.rs
+++ b/tests/expectations/tests/forward-declaration-autoptr.rs
@@ -15,8 +15,10 @@ pub struct RefPtr<T> {
pub m_inner: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for RefPtr<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for RefPtr<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy)]
@@ -25,28 +27,46 @@ pub struct Bar {
}
#[test]
fn bindgen_test_layout_Bar() {
- assert_eq!(::std::mem::size_of::<Bar>() , 8usize , concat ! (
- "Size of: " , stringify ! ( Bar ) ));
- assert_eq! (::std::mem::align_of::<Bar>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( Bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . m_member as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( m_member ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Bar>(),
+ 8usize,
+ concat!("Size of: ", stringify!(Bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Bar>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(Bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).m_member as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Bar),
+ "::",
+ stringify!(m_member)
+ )
+ );
}
impl Clone for Bar {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for Bar {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_RefPtr_open0_Foo_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<RefPtr<Foo>>() , 8usize , concat ! (
- "Size of template specialization: " , stringify ! ( RefPtr<Foo>
- ) ));
- assert_eq!(::std::mem::align_of::<RefPtr<Foo>>() , 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- RefPtr<Foo> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<RefPtr<Foo>>(),
+ 8usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( RefPtr < Foo > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < RefPtr < Foo > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( RefPtr < Foo > ) ) );
}
diff --git a/tests/expectations/tests/gen-constructors.rs b/tests/expectations/tests/gen-constructors.rs
index d0439864..c811efb8 100644
--- a/tests/expectations/tests/gen-constructors.rs
+++ b/tests/expectations/tests/gen-constructors.rs
@@ -11,17 +11,25 @@ pub struct Foo {
}
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
}
extern "C" {
#[link_name = "_ZN3FooC1Ei"]
pub fn Foo_Foo(this: *mut Foo, a: ::std::os::raw::c_int);
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Foo {
#[inline]
diff --git a/tests/expectations/tests/issue-410.rs b/tests/expectations/tests/issue-410.rs
index 9f0b9a14..b0366f1c 100644
--- a/tests/expectations/tests/issue-410.rs
+++ b/tests/expectations/tests/issue-410.rs
@@ -18,18 +18,25 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_Value() {
- assert_eq!(::std::mem::size_of::<Value>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Value ) ));
- assert_eq! (::std::mem::align_of::<Value>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Value ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Value>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Value))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Value>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Value))
+ );
}
extern "C" {
- #[link_name = "_ZN2JS5Value1aE10JSWhyMagic"]
- pub fn Value_a(this: *mut root::JS::Value,
- arg1: root::JSWhyMagic);
+ #[link_name = "_ZN2JS5Value1aE10JSWhyMagic"]
+ pub fn Value_a(this: *mut root::JS::Value, arg1: root::JSWhyMagic);
}
impl Clone for Value {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Value {
#[inline]
diff --git a/tests/expectations/tests/issue-447.rs b/tests/expectations/tests/issue-447.rs
index 4a7f07ed..7102235f 100644
--- a/tests/expectations/tests/issue-447.rs
+++ b/tests/expectations/tests/issue-447.rs
@@ -21,17 +21,21 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_GuardObjectNotifier() {
- assert_eq!(::std::mem::size_of::<GuardObjectNotifier>() ,
- 1usize , concat ! (
- "Size of: " , stringify ! ( GuardObjectNotifier )
- ));
- assert_eq! (::std::mem::align_of::<GuardObjectNotifier>() ,
- 1usize , concat ! (
- "Alignment of " , stringify ! (
- GuardObjectNotifier ) ));
+ assert_eq!(
+ ::std::mem::size_of::<GuardObjectNotifier>(),
+ 1usize,
+ concat!("Size of: ", stringify!(GuardObjectNotifier))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<GuardObjectNotifier>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(GuardObjectNotifier))
+ );
}
impl Clone for GuardObjectNotifier {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
}
}
@@ -42,28 +46,32 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_JSAutoCompartment() {
- assert_eq!(::std::mem::size_of::<JSAutoCompartment>() , 1usize ,
- concat ! ( "Size of: " , stringify ! ( JSAutoCompartment )
- ));
- assert_eq! (::std::mem::align_of::<JSAutoCompartment>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( JSAutoCompartment ) ));
+ assert_eq!(
+ ::std::mem::size_of::<JSAutoCompartment>(),
+ 1usize,
+ concat!("Size of: ", stringify!(JSAutoCompartment))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<JSAutoCompartment>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(JSAutoCompartment))
+ );
}
extern "C" {
- #[link_name =
- "_ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"]
- pub fn JSAutoCompartment_JSAutoCompartment(this:
- *mut root::JSAutoCompartment,
- arg1:
- root::mozilla::detail::GuardObjectNotifier);
+ #[link_name = "_ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"]
+ pub fn JSAutoCompartment_JSAutoCompartment(
+ this: *mut root::JSAutoCompartment,
+ arg1: root::mozilla::detail::GuardObjectNotifier,
+ );
}
impl Clone for JSAutoCompartment {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl JSAutoCompartment {
#[inline]
- pub unsafe fn new(arg1: root::mozilla::detail::GuardObjectNotifier)
- -> Self {
+ pub unsafe fn new(arg1: root::mozilla::detail::GuardObjectNotifier) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
JSAutoCompartment_JSAutoCompartment(&mut __bindgen_tmp, arg1);
__bindgen_tmp
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 85937c3f..27b5cfcd 100644
--- a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
+++ b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// 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
/// up with the reight alignment, we're waiting on `#[repr(align="N")]` to land
@@ -16,19 +17,31 @@ pub struct NoDebug {
}
#[test]
fn bindgen_test_layout_NoDebug() {
- assert_eq!(::std::mem::size_of::<NoDebug>() , 64usize , concat ! (
- "Size of: " , stringify ! ( NoDebug ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const NoDebug ) ) . c as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( NoDebug ) , "::" ,
- stringify ! ( c ) ));
+ assert_eq!(
+ ::std::mem::size_of::<NoDebug>(),
+ 64usize,
+ concat!("Size of: ", stringify!(NoDebug))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const NoDebug)).c as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(NoDebug),
+ "::",
+ stringify!(c)
+ )
+ );
}
impl Clone for NoDebug {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for NoDebug {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// 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
@@ -43,23 +56,39 @@ pub struct ShouldDeriveDebugButDoesNot {
}
#[test]
fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() {
- assert_eq!(::std::mem::size_of::<ShouldDeriveDebugButDoesNot>() , 64usize
- , concat ! (
- "Size of: " , stringify ! ( ShouldDeriveDebugButDoesNot ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldDeriveDebugButDoesNot ) ) . c as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- ShouldDeriveDebugButDoesNot ) , "::" , stringify ! ( c ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldDeriveDebugButDoesNot ) ) . d as *
- const _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! (
- ShouldDeriveDebugButDoesNot ) , "::" , stringify ! ( d ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldDeriveDebugButDoesNot>(),
+ 64usize,
+ concat!("Size of: ", stringify!(ShouldDeriveDebugButDoesNot))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldDeriveDebugButDoesNot)).c as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldDeriveDebugButDoesNot),
+ "::",
+ stringify!(c)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldDeriveDebugButDoesNot)).d as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldDeriveDebugButDoesNot),
+ "::",
+ stringify!(d)
+ )
+ );
}
impl Clone for ShouldDeriveDebugButDoesNot {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for ShouldDeriveDebugButDoesNot {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/issue-848-replacement-system-include.rs b/tests/expectations/tests/issue-848-replacement-system-include.rs
index 14083705..16fab93a 100644
--- a/tests/expectations/tests/issue-848-replacement-system-include.rs
+++ b/tests/expectations/tests/issue-848-replacement-system-include.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// This is intended to replace another type, but won't if we treat this include
/// as a system include, because clang doesn't parse comments there.
///
@@ -16,8 +17,10 @@ pub struct nsTArray<T> {
pub m: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for nsTArray<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for nsTArray<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "C" {
pub fn func() -> *mut nsTArray<::std::os::raw::c_int>;
diff --git a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs b/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs
index 10e54056..cd3d38c1 100644
--- a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs
+++ b/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs
@@ -5,6 +5,7 @@
pub struct BlacklistMe(u8);
+
/// Because this type contains a blacklisted type, it should not derive Copy.
#[repr(C)]
pub struct ShouldNotBeCopy {
@@ -12,16 +13,29 @@ pub struct ShouldNotBeCopy {
}
#[test]
fn bindgen_test_layout_ShouldNotBeCopy() {
- assert_eq!(::std::mem::size_of::<ShouldNotBeCopy>() , 1usize , concat ! (
- "Size of: " , stringify ! ( ShouldNotBeCopy ) ));
- assert_eq! (::std::mem::align_of::<ShouldNotBeCopy>() , 1usize , concat !
- ( "Alignment of " , stringify ! ( ShouldNotBeCopy ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ShouldNotBeCopy ) ) . a as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ShouldNotBeCopy ) ,
- "::" , stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ShouldNotBeCopy>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ShouldNotBeCopy))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ShouldNotBeCopy>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ShouldNotBeCopy))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ShouldNotBeCopy)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ShouldNotBeCopy),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Default for ShouldNotBeCopy {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/issue_315.rs b/tests/expectations/tests/issue_315.rs
index d5302451..d6660523 100644
--- a/tests/expectations/tests/issue_315.rs
+++ b/tests/expectations/tests/issue_315.rs
@@ -4,5 +4,6 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen replaces="c"></div>
pub type c<a> = a;
diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs
index 0a77b24e..2e93bb46 100644
--- a/tests/expectations/tests/jsval_layout_opaque.rs
+++ b/tests/expectations/tests/jsval_layout_opaque.rs
@@ -91,30 +91,37 @@ pub struct jsval_layout__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_1>() , 8usize ,
- concat ! (
- "Size of: " , stringify ! ( jsval_layout__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_1>() , 8usize
- , concat ! (
- "Alignment of " , stringify ! ( jsval_layout__bindgen_ty_1 )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_1>(),
+ 8usize,
+ concat!("Size of: ", stringify!(jsval_layout__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_1>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(jsval_layout__bindgen_ty_1))
+ );
}
impl Clone for jsval_layout__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for jsval_layout__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl jsval_layout__bindgen_ty_1 {
#[inline]
pub fn payload47(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 140737488355327u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -126,31 +133,31 @@ impl jsval_layout__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn tag(&self) -> JSValueTag {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 18446603336221196288u64 as u64;
let val = (unit_field_val & mask) >> 47usize;
@@ -162,31 +169,26 @@ impl jsval_layout__bindgen_ty_1 {
let val = val as u32 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 47usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn new_bitfield_1(payload47: u64, tag: JSValueTag) -> u64 {
- ({
- ({ 0 } |
- ((payload47 as u64 as u64) << 0usize) &
- (140737488355327u64 as u64))
- } |
- ((tag as u32 as u64) << 47usize) &
- (18446603336221196288u64 as u64))
+ ((0 | ((payload47 as u64 as u64) << 0usize) & (140737488355327u64 as u64)) |
+ ((tag as u32 as u64) << 47usize) & (18446603336221196288u64 as u64))
}
}
#[repr(C)]
@@ -204,111 +206,194 @@ pub union jsval_layout__bindgen_ty_2__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . i32 as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( i32 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . u32 as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( u32 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . why as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( why ) ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).i32 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(i32)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).u32 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(u32)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).why as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(why)
+ )
+ );
}
impl Clone for jsval_layout__bindgen_ty_2__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for jsval_layout__bindgen_ty_2__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2>() , 4usize ,
- concat ! (
- "Size of: " , stringify ! ( jsval_layout__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_2>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( jsval_layout__bindgen_ty_2 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout__bindgen_ty_2 ) ) . payload
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2 ) , "::" , stringify ! ( payload )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_2>(),
+ 4usize,
+ concat!("Size of: ", stringify!(jsval_layout__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(jsval_layout__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout__bindgen_ty_2)).payload as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2),
+ "::",
+ stringify!(payload)
+ )
+ );
}
impl Clone for jsval_layout__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for jsval_layout__bindgen_ty_2 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_jsval_layout() {
- assert_eq!(::std::mem::size_of::<jsval_layout>() , 8usize , concat ! (
- "Size of: " , stringify ! ( jsval_layout ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( jsval_layout ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asBits as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asBits ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . debugView as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( debugView ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . s as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( s ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asDouble as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asDouble ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asPtr as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asWord as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asWord ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asUIntPtr as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asUIntPtr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout>(),
+ 8usize,
+ concat!("Size of: ", stringify!(jsval_layout))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(jsval_layout))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asBits as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asBits)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).debugView as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(debugView)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).s as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(s)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asDouble as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asDouble)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asPtr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asPtr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asWord as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asWord)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asUIntPtr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asUIntPtr)
+ )
+ );
}
impl Clone for jsval_layout {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for jsval_layout {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -317,19 +402,34 @@ pub struct Value {
}
#[test]
fn bindgen_test_layout_Value() {
- assert_eq!(::std::mem::size_of::<Value>() , 8usize , concat ! (
- "Size of: " , stringify ! ( Value ) ));
- assert_eq! (::std::mem::align_of::<Value>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( Value ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Value ) ) . data as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Value ) , "::" ,
- stringify ! ( data ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Value>(),
+ 8usize,
+ concat!("Size of: ", stringify!(Value))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Value>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(Value))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Value)).data as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Value),
+ "::",
+ stringify!(data)
+ )
+ );
}
impl Clone for Value {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for Value {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/jsval_layout_opaque_1_0.rs b/tests/expectations/tests/jsval_layout_opaque_1_0.rs
index 563124d5..b818bf90 100644
--- a/tests/expectations/tests/jsval_layout_opaque_1_0.rs
+++ b/tests/expectations/tests/jsval_layout_opaque_1_0.rs
@@ -6,33 +6,45 @@
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl <T> __BindgenUnionField<T> {
+impl<T> __BindgenUnionField<T> {
#[inline]
- pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
+ pub fn new() -> Self {
+ __BindgenUnionField(::std::marker::PhantomData)
+ }
#[inline]
- pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
+ pub unsafe fn as_ref(&self) -> &T {
+ ::std::mem::transmute(self)
+ }
#[inline]
- pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
+ pub unsafe fn as_mut(&mut self) -> &mut T {
+ ::std::mem::transmute(self)
+ }
}
-impl <T> ::std::default::Default for __BindgenUnionField<T> {
+impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
- fn default() -> Self { Self::new() }
+ fn default() -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
+impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
- fn clone(&self) -> Self { Self::new() }
+ fn clone(&self) -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
-impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
+impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
+impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
-impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
- fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
+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 }
+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 JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47;
@@ -122,30 +134,37 @@ pub struct jsval_layout__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_1>() , 8usize ,
- concat ! (
- "Size of: " , stringify ! ( jsval_layout__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_1>() , 8usize
- , concat ! (
- "Alignment of " , stringify ! ( jsval_layout__bindgen_ty_1 )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_1>(),
+ 8usize,
+ concat!("Size of: ", stringify!(jsval_layout__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_1>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(jsval_layout__bindgen_ty_1))
+ );
}
impl Clone for jsval_layout__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for jsval_layout__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl jsval_layout__bindgen_ty_1 {
#[inline]
pub fn payload47(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 140737488355327u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -157,31 +176,31 @@ impl jsval_layout__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn tag(&self) -> JSValueTag {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 18446603336221196288u64 as u64;
let val = (unit_field_val & mask) >> 47usize;
@@ -193,31 +212,26 @@ impl jsval_layout__bindgen_ty_1 {
let val = val as u32 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 47usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn new_bitfield_1(payload47: u64, tag: JSValueTag) -> u64 {
- ({
- ({ 0 } |
- ((payload47 as u64 as u64) << 0usize) &
- (140737488355327u64 as u64))
- } |
- ((tag as u32 as u64) << 47usize) &
- (18446603336221196288u64 as u64))
+ ((0 | ((payload47 as u64 as u64) << 0usize) & (140737488355327u64 as u64)) |
+ ((tag as u32 as u64) << 47usize) & (18446603336221196288u64 as u64))
}
}
#[repr(C)]
@@ -235,102 +249,179 @@ pub struct jsval_layout__bindgen_ty_2__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . i32 as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( i32 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . u32 as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( u32 ) ));
- assert_eq! (unsafe {
- & (
- * ( 0 as * const jsval_layout__bindgen_ty_2__bindgen_ty_1 ) )
- . why as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2__bindgen_ty_1 ) , "::" , stringify
- ! ( why ) ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).i32 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(i32)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).u32 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(u32)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const jsval_layout__bindgen_ty_2__bindgen_ty_1)).why as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2__bindgen_ty_1),
+ "::",
+ stringify!(why)
+ )
+ );
}
impl Clone for jsval_layout__bindgen_ty_2__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_jsval_layout__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_2>() , 4usize ,
- concat ! (
- "Size of: " , stringify ! ( jsval_layout__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout__bindgen_ty_2>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( jsval_layout__bindgen_ty_2 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout__bindgen_ty_2 ) ) . payload
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- jsval_layout__bindgen_ty_2 ) , "::" , stringify ! ( payload )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout__bindgen_ty_2>(),
+ 4usize,
+ concat!("Size of: ", stringify!(jsval_layout__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(jsval_layout__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout__bindgen_ty_2)).payload as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout__bindgen_ty_2),
+ "::",
+ stringify!(payload)
+ )
+ );
}
impl Clone for jsval_layout__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_jsval_layout() {
- assert_eq!(::std::mem::size_of::<jsval_layout>() , 8usize , concat ! (
- "Size of: " , stringify ! ( jsval_layout ) ));
- assert_eq! (::std::mem::align_of::<jsval_layout>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( jsval_layout ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asBits as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asBits ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . debugView as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( debugView ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . s as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( s ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asDouble as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asDouble ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asPtr as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asWord as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asWord ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const jsval_layout ) ) . asUIntPtr as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( jsval_layout ) , "::" ,
- stringify ! ( asUIntPtr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<jsval_layout>(),
+ 8usize,
+ concat!("Size of: ", stringify!(jsval_layout))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<jsval_layout>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(jsval_layout))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asBits as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asBits)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).debugView as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(debugView)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).s as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(s)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asDouble as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asDouble)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asPtr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asPtr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asWord as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asWord)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const jsval_layout)).asUIntPtr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(jsval_layout),
+ "::",
+ stringify!(asUIntPtr)
+ )
+ );
}
impl Clone for jsval_layout {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq)]
@@ -339,16 +430,29 @@ pub struct Value {
}
#[test]
fn bindgen_test_layout_Value() {
- assert_eq!(::std::mem::size_of::<Value>() , 8usize , concat ! (
- "Size of: " , stringify ! ( Value ) ));
- assert_eq! (::std::mem::align_of::<Value>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( Value ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Value ) ) . data as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Value ) , "::" ,
- stringify ! ( data ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Value>(),
+ 8usize,
+ concat!("Size of: ", stringify!(Value))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Value>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(Value))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Value)).data as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Value),
+ "::",
+ stringify!(data)
+ )
+ );
}
impl Clone for Value {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/layout_align.rs b/tests/expectations/tests/layout_align.rs
index 102f1785..9e9ac872 100644
--- a/tests/expectations/tests/layout_align.rs
+++ b/tests/expectations/tests/layout_align.rs
@@ -7,13 +7,15 @@
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
-impl <T> __IncompleteArrayField<T> {
+impl<T> __IncompleteArrayField<T> {
#[inline]
pub fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData)
}
#[inline]
- pub unsafe fn as_ptr(&self) -> *const T { ::std::mem::transmute(self) }
+ pub unsafe fn as_ptr(&self) -> *const T {
+ ::std::mem::transmute(self)
+ }
#[inline]
pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
::std::mem::transmute(self)
@@ -27,16 +29,18 @@ impl <T> __IncompleteArrayField<T> {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
-impl <T> ::std::fmt::Debug for __IncompleteArrayField<T> {
+impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
-impl <T> ::std::clone::Clone for __IncompleteArrayField<T> {
+impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
- fn clone(&self) -> Self { Self::new() }
+ fn clone(&self) -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::marker::Copy for __IncompleteArrayField<T> { }
+impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
#[repr(C)]
#[derive(Debug)]
pub struct rte_kni_fifo {
@@ -54,13 +58,21 @@ pub struct rte_kni_fifo {
}
#[test]
fn bindgen_test_layout_rte_kni_fifo() {
- assert_eq!(::std::mem::size_of::<rte_kni_fifo>() , 16usize , concat ! (
- "Size of: " , stringify ! ( rte_kni_fifo ) ));
- assert_eq! (::std::mem::align_of::<rte_kni_fifo>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( rte_kni_fifo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_kni_fifo>(),
+ 16usize,
+ concat!("Size of: ", stringify!(rte_kni_fifo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_kni_fifo>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_kni_fifo))
+ );
}
impl Default for rte_kni_fifo {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
@@ -73,29 +85,42 @@ pub struct rte_eth_link {
}
#[test]
fn bindgen_test_layout_rte_eth_link() {
- assert_eq!(::std::mem::size_of::<rte_eth_link>() , 8usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_link ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_link>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_link ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_link ) ) . link_speed as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_link ) , "::" ,
- stringify ! ( link_speed ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_link>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_eth_link))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_link>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_link))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_link)).link_speed as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_link),
+ "::",
+ stringify!(link_speed)
+ )
+ );
}
impl Clone for rte_eth_link {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl rte_eth_link {
#[inline]
pub fn link_duplex(&self) -> u16 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -107,31 +132,31 @@ impl rte_eth_link {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn link_autoneg(&self) -> u16 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 2u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -143,31 +168,31 @@ impl rte_eth_link {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn link_status(&self) -> u16 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 4u64 as u8;
let val = (unit_field_val & mask) >> 2usize;
@@ -179,30 +204,26 @@ impl rte_eth_link {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(link_duplex: u16, link_autoneg: u16,
- link_status: u16) -> u8 {
- ({
- ({
- ({ 0 } |
- ((link_duplex as u16 as u8) << 0usize) & (1u64 as u8))
- } | ((link_autoneg as u16 as u8) << 1usize) & (2u64 as u8))
- } | ((link_status as u16 as u8) << 2usize) & (4u64 as u8))
+ pub fn new_bitfield_1(link_duplex: u16, link_autoneg: u16, link_status: u16) -> u8 {
+ (((0 | ((link_duplex as u16 as u8) << 0usize) & (1u64 as u8)) |
+ ((link_autoneg as u16 as u8) << 1usize) & (2u64 as u8)) |
+ ((link_status as u16 as u8) << 2usize) & (4u64 as u8))
}
}
diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs
index 94968579..be841432 100644
--- a/tests/expectations/tests/layout_cmdline_token.rs
+++ b/tests/expectations/tests/layout_cmdline_token.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// Stores a pointer to the ops struct, and the offset: the place to
/// write the parsed result in the destination structure.
#[repr(C)]
@@ -14,26 +15,46 @@ pub struct cmdline_token_hdr {
}
#[test]
fn bindgen_test_layout_cmdline_token_hdr() {
- assert_eq!(::std::mem::size_of::<cmdline_token_hdr>() , 16usize , concat !
- ( "Size of: " , stringify ! ( cmdline_token_hdr ) ));
- assert_eq! (::std::mem::align_of::<cmdline_token_hdr>() , 8usize , concat
- ! ( "Alignment of " , stringify ! ( cmdline_token_hdr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr ) ) . ops as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_hdr ) ,
- "::" , stringify ! ( ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_hdr ) ) . offset as * const
- _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_hdr ) ,
- "::" , stringify ! ( offset ) ));
+ assert_eq!(
+ ::std::mem::size_of::<cmdline_token_hdr>(),
+ 16usize,
+ concat!("Size of: ", stringify!(cmdline_token_hdr))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<cmdline_token_hdr>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(cmdline_token_hdr))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_hdr)).ops as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_hdr),
+ "::",
+ stringify!(ops)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_hdr)).offset as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_hdr),
+ "::",
+ stringify!(offset)
+ )
+ );
}
impl Clone for cmdline_token_hdr {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for cmdline_token_hdr {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub type cmdline_parse_token_hdr_t = cmdline_token_hdr;
/// A token is defined by this structure.
@@ -57,70 +78,99 @@ pub type cmdline_parse_token_hdr_t = cmdline_token_hdr;
#[derive(Debug, Copy)]
pub struct cmdline_token_ops {
/// parse(token ptr, buf, res pts, buf len)
- pub parse: ::std::option::Option<unsafe extern "C" fn(arg1:
- *mut cmdline_parse_token_hdr_t,
- arg2:
- *const ::std::os::raw::c_char,
- arg3:
- *mut ::std::os::raw::c_void,
- arg4:
- ::std::os::raw::c_uint)
- -> ::std::os::raw::c_int>,
+ pub parse: ::std::option::Option<
+ unsafe extern "C" fn(
+ arg1: *mut cmdline_parse_token_hdr_t,
+ arg2: *const ::std::os::raw::c_char,
+ arg3: *mut ::std::os::raw::c_void,
+ arg4: ::std::os::raw::c_uint,
+ ) -> ::std::os::raw::c_int,
+ >,
/// return the num of possible choices for this token
- pub complete_get_nb: ::std::option::Option<unsafe extern "C" fn(arg1:
- *mut cmdline_parse_token_hdr_t)
- -> ::std::os::raw::c_int>,
+ pub complete_get_nb: ::std::option::Option<
+ unsafe extern "C" fn(arg1: *mut cmdline_parse_token_hdr_t)
+ -> ::std::os::raw::c_int,
+ >,
/// return the elt x for this token (token, idx, dstbuf, size)
- pub complete_get_elt: ::std::option::Option<unsafe extern "C" fn(arg1:
- *mut cmdline_parse_token_hdr_t,
- arg2:
- ::std::os::raw::c_int,
- arg3:
- *mut ::std::os::raw::c_char,
- arg4:
- ::std::os::raw::c_uint)
- -> ::std::os::raw::c_int>,
+ pub complete_get_elt: ::std::option::Option<
+ unsafe extern "C" fn(
+ arg1: *mut cmdline_parse_token_hdr_t,
+ arg2: ::std::os::raw::c_int,
+ arg3: *mut ::std::os::raw::c_char,
+ arg4: ::std::os::raw::c_uint,
+ ) -> ::std::os::raw::c_int,
+ >,
/// get help for this token (token, dstbuf, size)
- pub get_help: ::std::option::Option<unsafe extern "C" fn(arg1:
- *mut cmdline_parse_token_hdr_t,
- arg2:
- *mut ::std::os::raw::c_char,
- arg3:
- ::std::os::raw::c_uint)
- -> ::std::os::raw::c_int>,
+ pub get_help: ::std::option::Option<
+ unsafe extern "C" fn(
+ arg1: *mut cmdline_parse_token_hdr_t,
+ arg2: *mut ::std::os::raw::c_char,
+ arg3: ::std::os::raw::c_uint,
+ ) -> ::std::os::raw::c_int,
+ >,
}
#[test]
fn bindgen_test_layout_cmdline_token_ops() {
- assert_eq!(::std::mem::size_of::<cmdline_token_ops>() , 32usize , concat !
- ( "Size of: " , stringify ! ( cmdline_token_ops ) ));
- assert_eq! (::std::mem::align_of::<cmdline_token_ops>() , 8usize , concat
- ! ( "Alignment of " , stringify ! ( cmdline_token_ops ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_ops ) ) . parse as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_ops ) ,
- "::" , stringify ! ( parse ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_ops ) ) . complete_get_nb
- as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_ops ) ,
- "::" , stringify ! ( complete_get_nb ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_ops ) ) . complete_get_elt
- as * const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_ops ) ,
- "::" , stringify ! ( complete_get_elt ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_ops ) ) . get_help as *
- const _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_ops ) ,
- "::" , stringify ! ( get_help ) ));
+ assert_eq!(
+ ::std::mem::size_of::<cmdline_token_ops>(),
+ 32usize,
+ concat!("Size of: ", stringify!(cmdline_token_ops))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<cmdline_token_ops>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(cmdline_token_ops))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_ops)).parse as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_ops),
+ "::",
+ stringify!(parse)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_ops)).complete_get_nb as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_ops),
+ "::",
+ stringify!(complete_get_nb)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_ops)).complete_get_elt as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_ops),
+ "::",
+ stringify!(complete_get_elt)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_ops)).get_help as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_ops),
+ "::",
+ stringify!(get_help)
+ )
+ );
}
impl Clone for cmdline_token_ops {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for cmdline_token_ops {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
@@ -141,23 +191,36 @@ pub struct cmdline_token_num_data {
}
#[test]
fn bindgen_test_layout_cmdline_token_num_data() {
- assert_eq!(::std::mem::size_of::<cmdline_token_num_data>() , 4usize ,
- concat ! ( "Size of: " , stringify ! ( cmdline_token_num_data )
- ));
- assert_eq! (::std::mem::align_of::<cmdline_token_num_data>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( cmdline_token_num_data ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num_data ) ) . type_ as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num_data
- ) , "::" , stringify ! ( type_ ) ));
+ assert_eq!(
+ ::std::mem::size_of::<cmdline_token_num_data>(),
+ 4usize,
+ concat!("Size of: ", stringify!(cmdline_token_num_data))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<cmdline_token_num_data>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(cmdline_token_num_data))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_num_data)).type_ as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_num_data),
+ "::",
+ stringify!(type_)
+ )
+ );
}
impl Clone for cmdline_token_num_data {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for cmdline_token_num_data {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy)]
@@ -167,25 +230,45 @@ pub struct cmdline_token_num {
}
#[test]
fn bindgen_test_layout_cmdline_token_num() {
- assert_eq!(::std::mem::size_of::<cmdline_token_num>() , 24usize , concat !
- ( "Size of: " , stringify ! ( cmdline_token_num ) ));
- assert_eq! (::std::mem::align_of::<cmdline_token_num>() , 8usize , concat
- ! ( "Alignment of " , stringify ! ( cmdline_token_num ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num ) ) . hdr as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num ) ,
- "::" , stringify ! ( hdr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const cmdline_token_num ) ) . num_data as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( cmdline_token_num ) ,
- "::" , stringify ! ( num_data ) ));
+ assert_eq!(
+ ::std::mem::size_of::<cmdline_token_num>(),
+ 24usize,
+ concat!("Size of: ", stringify!(cmdline_token_num))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<cmdline_token_num>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(cmdline_token_num))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_num)).hdr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_num),
+ "::",
+ stringify!(hdr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const cmdline_token_num)).num_data as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(cmdline_token_num),
+ "::",
+ stringify!(num_data)
+ )
+ );
}
impl Clone for cmdline_token_num {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for cmdline_token_num {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub type cmdline_parse_token_num_t = cmdline_token_num;
diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs
index 38c105d3..8c2889ba 100644
--- a/tests/expectations/tests/layout_eth_conf.rs
+++ b/tests/expectations/tests/layout_eth_conf.rs
@@ -64,42 +64,67 @@ pub struct rte_eth_rxmode {
}
#[test]
fn bindgen_test_layout_rte_eth_rxmode() {
- assert_eq!(::std::mem::size_of::<rte_eth_rxmode>() , 12usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_rxmode ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_rxmode>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . max_rx_pkt_len as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( max_rx_pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . split_hdr_size as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( split_hdr_size ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_rxmode>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_rxmode))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_rxmode>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_rxmode))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).mq_mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(mq_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).max_rx_pkt_len as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(max_rx_pkt_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).split_hdr_size as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(split_hdr_size)
+ )
+ );
}
impl Clone for rte_eth_rxmode {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_rxmode {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl rte_eth_rxmode {
#[inline]
pub fn header_split(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 1u64 as u16;
let val = (unit_field_val & mask) >> 0usize;
@@ -111,31 +136,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_ip_checksum(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 2u64 as u16;
let val = (unit_field_val & mask) >> 1usize;
@@ -147,31 +172,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_filter(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 4u64 as u16;
let val = (unit_field_val & mask) >> 2usize;
@@ -183,31 +208,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_strip(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 8u64 as u16;
let val = (unit_field_val & mask) >> 3usize;
@@ -219,31 +244,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_extend(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 16u64 as u16;
let val = (unit_field_val & mask) >> 4usize;
@@ -255,31 +280,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn jumbo_frame(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 32u64 as u16;
let val = (unit_field_val & mask) >> 5usize;
@@ -291,31 +316,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 5usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_strip_crc(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 64u64 as u16;
let val = (unit_field_val & mask) >> 6usize;
@@ -327,31 +352,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn enable_scatter(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 128u64 as u16;
let val = (unit_field_val & mask) >> 7usize;
@@ -363,31 +388,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn enable_lro(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 256u64 as u16;
let val = (unit_field_val & mask) >> 8usize;
@@ -399,63 +424,43 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(header_split: u16, hw_ip_checksum: u16,
- hw_vlan_filter: u16, hw_vlan_strip: u16,
- hw_vlan_extend: u16, jumbo_frame: u16,
- hw_strip_crc: u16, enable_scatter: u16,
- enable_lro: u16) -> u16 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((header_split as u16 as
- u16) << 0usize) &
- (1u64 as u16))
- } |
- ((hw_ip_checksum as u16 as
- u16) << 1usize) &
- (2u64 as u16))
- } |
- ((hw_vlan_filter as u16 as u16) <<
- 2usize) & (4u64 as u16))
- } |
- ((hw_vlan_strip as u16 as u16) <<
- 3usize) & (8u64 as u16))
- } |
- ((hw_vlan_extend as u16 as u16) << 4usize) &
- (16u64 as u16))
- } |
- ((jumbo_frame as u16 as u16) << 5usize) &
- (32u64 as u16))
- } |
- ((hw_strip_crc as u16 as u16) << 6usize) &
- (64u64 as u16))
- } |
- ((enable_scatter as u16 as u16) << 7usize) &
- (128u64 as u16))
- } | ((enable_lro as u16 as u16) << 8usize) & (256u64 as u16))
+ pub fn new_bitfield_1(
+ header_split: u16,
+ hw_ip_checksum: u16,
+ hw_vlan_filter: u16,
+ hw_vlan_strip: u16,
+ hw_vlan_extend: u16,
+ jumbo_frame: u16,
+ hw_strip_crc: u16,
+ enable_scatter: u16,
+ enable_lro: u16,
+ ) -> u16 {
+ (((((((((0 | ((header_split as u16 as u16) << 0usize) & (1u64 as u16)) |
+ ((hw_ip_checksum as u16 as u16) << 1usize) & (2u64 as u16)) |
+ ((hw_vlan_filter as u16 as u16) << 2usize) & (4u64 as u16)) |
+ ((hw_vlan_strip as u16 as u16) << 3usize) & (8u64 as u16)) |
+ ((hw_vlan_extend as u16 as u16) << 4usize) & (16u64 as u16)) |
+ ((jumbo_frame as u16 as u16) << 5usize) & (32u64 as u16)) |
+ ((hw_strip_crc as u16 as u16) << 6usize) & (64u64 as u16)) |
+ ((enable_scatter as u16 as u16) << 7usize) & (128u64 as u16)) |
+ ((enable_lro as u16 as u16) << 8usize) & (256u64 as u16))
}
}
#[repr(u32)]
@@ -480,37 +485,57 @@ pub struct rte_eth_txmode {
}
#[test]
fn bindgen_test_layout_rte_eth_txmode() {
- assert_eq!(::std::mem::size_of::<rte_eth_txmode>() , 8usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_txmode ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_txmode>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . pvid as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( pvid ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_txmode>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_eth_txmode))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_txmode>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_txmode))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_txmode)).mq_mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_txmode),
+ "::",
+ stringify!(mq_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_txmode)).pvid as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_txmode),
+ "::",
+ stringify!(pvid)
+ )
+ );
}
impl Clone for rte_eth_txmode {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_txmode {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl rte_eth_txmode {
#[inline]
pub fn hw_vlan_reject_tagged(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -522,31 +547,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn hw_vlan_reject_untagged(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 2u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -558,31 +583,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn hw_vlan_insert_pvid(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 4u64 as u8;
let val = (unit_field_val & mask) >> 2usize;
@@ -594,35 +619,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(hw_vlan_reject_tagged: u8,
- hw_vlan_reject_untagged: u8,
- hw_vlan_insert_pvid: u8) -> u8 {
- ({
- ({
- ({ 0 } |
- ((hw_vlan_reject_tagged as u8 as u8) << 0usize) &
- (1u64 as u8))
- } |
- ((hw_vlan_reject_untagged as u8 as u8) << 1usize) &
- (2u64 as u8))
- } | ((hw_vlan_insert_pvid as u8 as u8) << 2usize) & (4u64 as u8))
+ pub fn new_bitfield_1(
+ hw_vlan_reject_tagged: u8,
+ hw_vlan_reject_untagged: u8,
+ hw_vlan_insert_pvid: u8,
+ ) -> u8 {
+ (((0 | ((hw_vlan_reject_tagged as u8 as u8) << 0usize) & (1u64 as u8)) |
+ ((hw_vlan_reject_untagged as u8 as u8) << 1usize) & (2u64 as u8)) |
+ ((hw_vlan_insert_pvid as u8 as u8) << 2usize) & (4u64 as u8))
}
}
/// A structure used to configure the Receive Side Scaling (RSS) feature
@@ -652,37 +673,65 @@ pub struct rte_eth_rss_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_rss_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_rss_conf>() , 24usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_rss_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_rss_conf>() , 8usize , concat !
- ( "Alignment of " , stringify ! ( rte_eth_rss_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key_len as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_hf as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_hf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_rss_conf>(),
+ 24usize,
+ concat!("Size of: ", stringify!(rte_eth_rss_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_rss_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_rss_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_key)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key_len as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_key_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_hf as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_hf)
+ )
+ );
}
impl Clone for rte_eth_rss_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_rss_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(u32)]
/// This enum indicates the possible number of traffic classes
/// in DCB configratioins
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum rte_eth_nb_tcs { ETH_4_TCS = 4, ETH_8_TCS = 8, }
+pub enum rte_eth_nb_tcs {
+ ETH_4_TCS = 4,
+ ETH_8_TCS = 8,
+}
#[repr(u32)]
/// This enum indicates the possible number of queue pools
/// in VMDQ configurations.
@@ -727,75 +776,129 @@ pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>() ,
- 16usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>()
- , 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
+ 16usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).vlan_id as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1),
+ "::",
+ stringify!(vlan_id)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).pools as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1),
+ "::",
+ stringify!(pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf>() , 1040usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . nb_pool_maps
- as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . pool_map as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( pool_map ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . dcb_tc as *
- const _ as usize } , 1032usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_conf>(),
+ 1040usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_dcb_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).enable_default_pool as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(enable_default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).default_pool as *const _ as usize },
+ 5usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_pool_maps as *const _ as usize },
+ 6usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(nb_pool_maps)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).pool_map as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(pool_map)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).dcb_tc as *const _ as usize },
+ 1032usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_dcb_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -807,27 +910,46 @@ pub struct rte_eth_dcb_rx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_rx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_dcb_rx_conf>() , 12usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_dcb_rx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_dcb_rx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_dcb_rx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_dcb_rx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_dcb_rx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_dcb_rx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).nb_tcs as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_rx_conf),
+ "::",
+ stringify!(nb_tcs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_rx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_dcb_rx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_dcb_rx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -839,29 +961,46 @@ pub struct rte_eth_vmdq_dcb_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>() , 12usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! (
- nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) . dcb_tc as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_dcb_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_tx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_tx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_dcb_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -873,27 +1012,46 @@ pub struct rte_eth_dcb_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_dcb_tx_conf>() , 12usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_dcb_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_dcb_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_dcb_tx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_dcb_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_dcb_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_dcb_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).nb_tcs as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_tx_conf),
+ "::",
+ stringify!(nb_tcs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_tx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_dcb_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_dcb_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -903,22 +1061,36 @@ pub struct rte_eth_vmdq_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_tx_conf>() , 4usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_tx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_tx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_tx_conf>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_tx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_tx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -948,80 +1120,139 @@ pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
- 16usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_rx_conf__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
+ 16usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).vlan_id as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1),
+ "::",
+ stringify!(vlan_id)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).pools as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1),
+ "::",
+ stringify!(pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_rx_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf>() , 1040usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_rx_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_loop_back as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_loop_back ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_pool_maps
- as * const _ as usize } , 7usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . rx_mode as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( rx_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . pool_map as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( pool_map ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_rx_conf>(),
+ 1040usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_rx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_rx_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_rx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_default_pool as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(enable_default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).default_pool as *const _ as usize },
+ 5usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_loop_back as *const _ as usize },
+ 6usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(enable_loop_back)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_pool_maps as *const _ as usize },
+ 7usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(nb_pool_maps)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).rx_mode as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(rx_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).pool_map as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(pool_map)
+ )
+ );
}
impl Clone for rte_eth_vmdq_rx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_rx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(u32)]
/// Flow Director setting modes: none, signature or perfect.
@@ -1067,38 +1298,71 @@ pub struct rte_eth_ipv4_flow {
}
#[test]
fn bindgen_test_layout_rte_eth_ipv4_flow() {
- assert_eq!(::std::mem::size_of::<rte_eth_ipv4_flow>() , 12usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_ipv4_flow ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_ipv4_flow>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_ipv4_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . dst_ip as * const
- _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . tos as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( tos ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . ttl as * const _
- as usize } , 9usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( ttl ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . proto as * const
- _ as usize } , 10usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( proto ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_ipv4_flow>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_ipv4_flow))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_ipv4_flow>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_ipv4_flow))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).src_ip as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(src_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).dst_ip as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(dst_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).tos as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(tos)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).ttl as *const _ as usize },
+ 9usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(ttl)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).proto as *const _ as usize },
+ 10usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(proto)
+ )
+ );
}
impl Clone for rte_eth_ipv4_flow {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to define the input for IPV6 flow
#[repr(C)]
@@ -1117,38 +1381,71 @@ pub struct rte_eth_ipv6_flow {
}
#[test]
fn bindgen_test_layout_rte_eth_ipv6_flow() {
- assert_eq!(::std::mem::size_of::<rte_eth_ipv6_flow>() , 36usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_ipv6_flow ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_ipv6_flow>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_ipv6_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . dst_ip as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . tc as * const _
- as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( tc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . proto as * const
- _ as usize } , 33usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( proto ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . hop_limits as *
- const _ as usize } , 34usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( hop_limits ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_ipv6_flow>(),
+ 36usize,
+ concat!("Size of: ", stringify!(rte_eth_ipv6_flow))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_ipv6_flow>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_ipv6_flow))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).src_ip as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(src_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).dst_ip as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(dst_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).tc as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(tc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).proto as *const _ as usize },
+ 33usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(proto)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).hop_limits as *const _ as usize },
+ 34usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(hop_limits)
+ )
+ );
}
impl Clone for rte_eth_ipv6_flow {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to configure FDIR masks that are used by the device
/// to match the various fields of RX packet headers.
@@ -1176,54 +1473,101 @@ pub struct rte_eth_fdir_masks {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_masks() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_masks>() , 68usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_fdir_masks ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_masks>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_fdir_masks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . vlan_tci_mask as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( vlan_tci_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv4_mask as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv4_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv6_mask as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv6_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . src_port_mask as
- * const _ as usize } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( src_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . dst_port_mask as
- * const _ as usize } , 54usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( dst_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) .
- mac_addr_byte_mask as * const _ as usize } , 56usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( mac_addr_byte_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_id_mask
- as * const _ as usize } , 60usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_id_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_type_mask
- as * const _ as usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_type_mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_masks>(),
+ 68usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_masks))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_masks>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_masks))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).vlan_tci_mask as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(vlan_tci_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv4_mask as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(ipv4_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv6_mask as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(ipv6_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).src_port_mask as *const _ as usize },
+ 52usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(src_port_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).dst_port_mask as *const _ as usize },
+ 54usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(dst_port_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).mac_addr_byte_mask as *const _ as usize },
+ 56usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(mac_addr_byte_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_id_mask as *const _ as usize },
+ 60usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(tunnel_id_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_type_mask as *const _ as usize },
+ 64usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(tunnel_type_mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_masks {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(u32)]
/// Payload type
@@ -1247,29 +1591,46 @@ pub struct rte_eth_flex_payload_cfg {
}
#[test]
fn bindgen_test_layout_rte_eth_flex_payload_cfg() {
- assert_eq!(::std::mem::size_of::<rte_eth_flex_payload_cfg>() , 36usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_flex_payload_cfg ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_flex_payload_cfg>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_flex_payload_cfg ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . type_ as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( type_ ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . src_offset
- as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( src_offset )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_flex_payload_cfg>(),
+ 36usize,
+ concat!("Size of: ", stringify!(rte_eth_flex_payload_cfg))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_flex_payload_cfg>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_flex_payload_cfg))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).type_ as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_flex_payload_cfg),
+ "::",
+ stringify!(type_)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).src_offset as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_flex_payload_cfg),
+ "::",
+ stringify!(src_offset)
+ )
+ );
}
impl Clone for rte_eth_flex_payload_cfg {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_flex_payload_cfg {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to define FDIR masks for flexible payload
/// for each flow type
@@ -1281,25 +1642,41 @@ pub struct rte_eth_fdir_flex_mask {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_mask() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_mask>() , 18usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_mask )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_mask>() , 2usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_fdir_flex_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . flow_type as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( flow_type ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . mask as *
- const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_flex_mask>(),
+ 18usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_flex_mask))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_flex_mask>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_flex_mask))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).flow_type as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_mask),
+ "::",
+ stringify!(flow_type)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).mask as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_mask),
+ "::",
+ stringify!(mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_flex_mask {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to define all flexible payload related setting
/// include flex payload and flex mask
@@ -1315,38 +1692,66 @@ pub struct rte_eth_fdir_flex_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_conf>() , 688usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_fdir_flex_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_payloads
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_payloads ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_flexmasks
- as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_flexmasks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_set as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_set ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_mask as
- * const _ as usize } , 292usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_flex_conf>(),
+ 688usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_flex_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_flex_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_flex_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_payloads as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(nb_payloads)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_flexmasks as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(nb_flexmasks)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_set as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(flex_set)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_mask as *const _ as usize },
+ 292usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(flex_mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_flex_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_fdir_flex_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to configure the Flow Director (FDIR) feature
/// of an Ethernet port.
@@ -1368,46 +1773,86 @@ pub struct rte_fdir_conf {
}
#[test]
fn bindgen_test_layout_rte_fdir_conf() {
- assert_eq!(::std::mem::size_of::<rte_fdir_conf>() , 772usize , concat ! (
- "Size of: " , stringify ! ( rte_fdir_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_fdir_conf>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mode as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . pballoc as * const _
- as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( pballoc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . status as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( status ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . drop_queue as * const
- _ as usize } , 12usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( drop_queue ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mask as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . flex_conf as * const
- _ as usize } , 84usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( flex_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_fdir_conf>(),
+ 772usize,
+ concat!("Size of: ", stringify!(rte_fdir_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_fdir_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_fdir_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).pballoc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(pballoc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).status as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(status)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).drop_queue as *const _ as usize },
+ 12usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(drop_queue)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).mask as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).flex_conf as *const _ as usize },
+ 84usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(flex_conf)
+ )
+ );
}
impl Clone for rte_fdir_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_fdir_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to enable/disable specific device interrupts.
#[repr(C)]
@@ -1420,23 +1865,41 @@ pub struct rte_intr_conf {
}
#[test]
fn bindgen_test_layout_rte_intr_conf() {
- assert_eq!(::std::mem::size_of::<rte_intr_conf>() , 4usize , concat ! (
- "Size of: " , stringify ! ( rte_intr_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_intr_conf>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( rte_intr_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . lsc as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( lsc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . rxq as * const _ as
- usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( rxq ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_intr_conf>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_intr_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_intr_conf>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_intr_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_intr_conf)).lsc as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_intr_conf),
+ "::",
+ stringify!(lsc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_intr_conf)).rxq as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_intr_conf),
+ "::",
+ stringify!(rxq)
+ )
+ );
}
impl Clone for rte_intr_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to configure an Ethernet port.
/// Depending upon the RX multi-queue mode, extra advanced
@@ -1485,43 +1948,66 @@ pub struct rte_eth_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>() , 2120usize
- , concat ! (
- "Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>() , 8usize
- , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) . rss_conf
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! ( rss_conf )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_dcb_conf as * const _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- dcb_rx_conf as * const _ as usize } , 1064usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_rx_conf as * const _ as usize } , 1080usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_rx_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>(),
+ 2120usize,
+ concat!("Size of: ", stringify!(rte_eth_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).rss_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(rss_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_dcb_conf as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(vmdq_dcb_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).dcb_rx_conf as *const _ as usize },
+ 1064usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(dcb_rx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_rx_conf as *const _ as usize },
+ 1080usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(vmdq_rx_conf)
+ )
+ );
}
impl Clone for rte_eth_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_conf__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -1533,93 +2019,169 @@ pub union rte_eth_conf__bindgen_ty_2 {
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>() , 12usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_2 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_tx_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_conf__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_dcb_tx_conf as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(vmdq_dcb_tx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).dcb_tx_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(dcb_tx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_tx_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(vmdq_tx_conf)
+ )
+ );
}
impl Clone for rte_eth_conf__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_conf__bindgen_ty_2 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf>() , 2944usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . link_speeds as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( link_speeds ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rxmode as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . txmode as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . lpbk_mode as * const _
- as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( lpbk_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rx_adv_conf as * const
- _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . tx_adv_conf as * const
- _ as usize } , 2152usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( tx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . dcb_capability_en as *
- const _ as usize } , 2164usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( dcb_capability_en ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . fdir_conf as * const _
- as usize } , 2168usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . intr_conf as * const _
- as usize } , 2940usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( intr_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf>(),
+ 2944usize,
+ concat!("Size of: ", stringify!(rte_eth_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).link_speeds as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(link_speeds)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).rxmode as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(rxmode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).txmode as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(txmode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).lpbk_mode as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(lpbk_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).rx_adv_conf as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(rx_adv_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).tx_adv_conf as *const _ as usize },
+ 2152usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(tx_adv_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).dcb_capability_en as *const _ as usize },
+ 2164usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(dcb_capability_en)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).fdir_conf as *const _ as usize },
+ 2168usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(fdir_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).intr_conf as *const _ as usize },
+ 2940usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(intr_conf)
+ )
+ );
}
impl Clone for rte_eth_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/layout_eth_conf_1_0.rs b/tests/expectations/tests/layout_eth_conf_1_0.rs
index c03a3dd4..88e931b6 100644
--- a/tests/expectations/tests/layout_eth_conf_1_0.rs
+++ b/tests/expectations/tests/layout_eth_conf_1_0.rs
@@ -6,33 +6,45 @@
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl <T> __BindgenUnionField<T> {
+impl<T> __BindgenUnionField<T> {
#[inline]
- pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
+ pub fn new() -> Self {
+ __BindgenUnionField(::std::marker::PhantomData)
+ }
#[inline]
- pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
+ pub unsafe fn as_ref(&self) -> &T {
+ ::std::mem::transmute(self)
+ }
#[inline]
- pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
+ pub unsafe fn as_mut(&mut self) -> &mut T {
+ ::std::mem::transmute(self)
+ }
}
-impl <T> ::std::default::Default for __BindgenUnionField<T> {
+impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
- fn default() -> Self { Self::new() }
+ fn default() -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
+impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
- fn clone(&self) -> Self { Self::new() }
+ fn clone(&self) -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
-impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
+impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
+impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
-impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
- fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
+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 }
+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;
@@ -95,42 +107,67 @@ pub struct rte_eth_rxmode {
}
#[test]
fn bindgen_test_layout_rte_eth_rxmode() {
- assert_eq!(::std::mem::size_of::<rte_eth_rxmode>() , 12usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_rxmode ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_rxmode>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . max_rx_pkt_len as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( max_rx_pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rxmode ) ) . split_hdr_size as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rxmode ) , "::"
- , stringify ! ( split_hdr_size ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_rxmode>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_rxmode))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_rxmode>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_rxmode))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).mq_mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(mq_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).max_rx_pkt_len as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(max_rx_pkt_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rxmode)).split_hdr_size as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rxmode),
+ "::",
+ stringify!(split_hdr_size)
+ )
+ );
}
impl Clone for rte_eth_rxmode {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_rxmode {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl rte_eth_rxmode {
#[inline]
pub fn header_split(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 1u64 as u16;
let val = (unit_field_val & mask) >> 0usize;
@@ -142,31 +179,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_ip_checksum(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 2u64 as u16;
let val = (unit_field_val & mask) >> 1usize;
@@ -178,31 +215,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_filter(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 4u64 as u16;
let val = (unit_field_val & mask) >> 2usize;
@@ -214,31 +251,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_strip(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 8u64 as u16;
let val = (unit_field_val & mask) >> 3usize;
@@ -250,31 +287,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_vlan_extend(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 16u64 as u16;
let val = (unit_field_val & mask) >> 4usize;
@@ -286,31 +323,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn jumbo_frame(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 32u64 as u16;
let val = (unit_field_val & mask) >> 5usize;
@@ -322,31 +359,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 5usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn hw_strip_crc(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 64u64 as u16;
let val = (unit_field_val & mask) >> 6usize;
@@ -358,31 +395,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn enable_scatter(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 128u64 as u16;
let val = (unit_field_val & mask) >> 7usize;
@@ -394,31 +431,31 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn enable_lro(&self) -> u16 {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 256u64 as u16;
let val = (unit_field_val & mask) >> 8usize;
@@ -430,63 +467,43 @@ impl rte_eth_rxmode {
let val = val as u16 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(header_split: u16, hw_ip_checksum: u16,
- hw_vlan_filter: u16, hw_vlan_strip: u16,
- hw_vlan_extend: u16, jumbo_frame: u16,
- hw_strip_crc: u16, enable_scatter: u16,
- enable_lro: u16) -> u16 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((header_split as u16 as
- u16) << 0usize) &
- (1u64 as u16))
- } |
- ((hw_ip_checksum as u16 as
- u16) << 1usize) &
- (2u64 as u16))
- } |
- ((hw_vlan_filter as u16 as u16) <<
- 2usize) & (4u64 as u16))
- } |
- ((hw_vlan_strip as u16 as u16) <<
- 3usize) & (8u64 as u16))
- } |
- ((hw_vlan_extend as u16 as u16) << 4usize) &
- (16u64 as u16))
- } |
- ((jumbo_frame as u16 as u16) << 5usize) &
- (32u64 as u16))
- } |
- ((hw_strip_crc as u16 as u16) << 6usize) &
- (64u64 as u16))
- } |
- ((enable_scatter as u16 as u16) << 7usize) &
- (128u64 as u16))
- } | ((enable_lro as u16 as u16) << 8usize) & (256u64 as u16))
+ pub fn new_bitfield_1(
+ header_split: u16,
+ hw_ip_checksum: u16,
+ hw_vlan_filter: u16,
+ hw_vlan_strip: u16,
+ hw_vlan_extend: u16,
+ jumbo_frame: u16,
+ hw_strip_crc: u16,
+ enable_scatter: u16,
+ enable_lro: u16,
+ ) -> u16 {
+ (((((((((0 | ((header_split as u16 as u16) << 0usize) & (1u64 as u16)) |
+ ((hw_ip_checksum as u16 as u16) << 1usize) & (2u64 as u16)) |
+ ((hw_vlan_filter as u16 as u16) << 2usize) & (4u64 as u16)) |
+ ((hw_vlan_strip as u16 as u16) << 3usize) & (8u64 as u16)) |
+ ((hw_vlan_extend as u16 as u16) << 4usize) & (16u64 as u16)) |
+ ((jumbo_frame as u16 as u16) << 5usize) & (32u64 as u16)) |
+ ((hw_strip_crc as u16 as u16) << 6usize) & (64u64 as u16)) |
+ ((enable_scatter as u16 as u16) << 7usize) & (128u64 as u16)) |
+ ((enable_lro as u16 as u16) << 8usize) & (256u64 as u16))
}
}
#[repr(u32)]
@@ -511,37 +528,57 @@ pub struct rte_eth_txmode {
}
#[test]
fn bindgen_test_layout_rte_eth_txmode() {
- assert_eq!(::std::mem::size_of::<rte_eth_txmode>() , 8usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_txmode ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_txmode>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . mq_mode as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( mq_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_txmode ) ) . pvid as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_txmode ) , "::"
- , stringify ! ( pvid ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_txmode>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_eth_txmode))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_txmode>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_txmode))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_txmode)).mq_mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_txmode),
+ "::",
+ stringify!(mq_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_txmode)).pvid as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_txmode),
+ "::",
+ stringify!(pvid)
+ )
+ );
}
impl Clone for rte_eth_txmode {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_txmode {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl rte_eth_txmode {
#[inline]
pub fn hw_vlan_reject_tagged(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -553,31 +590,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn hw_vlan_reject_untagged(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 2u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -589,31 +626,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn hw_vlan_insert_pvid(&self) -> u8 {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 4u64 as u8;
let val = (unit_field_val & mask) >> 2usize;
@@ -625,35 +662,31 @@ impl rte_eth_txmode {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(hw_vlan_reject_tagged: u8,
- hw_vlan_reject_untagged: u8,
- hw_vlan_insert_pvid: u8) -> u8 {
- ({
- ({
- ({ 0 } |
- ((hw_vlan_reject_tagged as u8 as u8) << 0usize) &
- (1u64 as u8))
- } |
- ((hw_vlan_reject_untagged as u8 as u8) << 1usize) &
- (2u64 as u8))
- } | ((hw_vlan_insert_pvid as u8 as u8) << 2usize) & (4u64 as u8))
+ pub fn new_bitfield_1(
+ hw_vlan_reject_tagged: u8,
+ hw_vlan_reject_untagged: u8,
+ hw_vlan_insert_pvid: u8,
+ ) -> u8 {
+ (((0 | ((hw_vlan_reject_tagged as u8 as u8) << 0usize) & (1u64 as u8)) |
+ ((hw_vlan_reject_untagged as u8 as u8) << 1usize) & (2u64 as u8)) |
+ ((hw_vlan_insert_pvid as u8 as u8) << 2usize) & (4u64 as u8))
}
}
/// A structure used to configure the Receive Side Scaling (RSS) feature
@@ -683,37 +716,65 @@ pub struct rte_eth_rss_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_rss_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_rss_conf>() , 24usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_rss_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_rss_conf>() , 8usize , concat !
- ( "Alignment of " , stringify ! ( rte_eth_rss_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_key_len as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_key_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_rss_conf ) ) . rss_hf as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_rss_conf ) ,
- "::" , stringify ! ( rss_hf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_rss_conf>(),
+ 24usize,
+ concat!("Size of: ", stringify!(rte_eth_rss_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_rss_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_rss_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_key)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_key_len as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_key_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_rss_conf)).rss_hf as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_rss_conf),
+ "::",
+ stringify!(rss_hf)
+ )
+ );
}
impl Clone for rte_eth_rss_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_rss_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(u32)]
/// This enum indicates the possible number of traffic classes
/// in DCB configratioins
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum rte_eth_nb_tcs { ETH_4_TCS = 4, ETH_8_TCS = 8, }
+pub enum rte_eth_nb_tcs {
+ ETH_4_TCS = 4,
+ ETH_8_TCS = 8,
+}
#[repr(u32)]
/// This enum indicates the possible number of queue pools
/// in VMDQ configurations.
@@ -758,75 +819,129 @@ pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>() ,
- 16usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>()
- , 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
+ 16usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).vlan_id as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1),
+ "::",
+ stringify!(vlan_id)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf__bindgen_ty_1)).pools as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf__bindgen_ty_1),
+ "::",
+ stringify!(pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_conf>() , 1040usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_conf>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . nb_pool_maps
- as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . pool_map as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( pool_map ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_conf ) ) . dcb_tc as *
- const _ as usize } , 1032usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_dcb_conf )
- , "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_conf>(),
+ 1040usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_dcb_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).enable_default_pool as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(enable_default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).default_pool as *const _ as usize },
+ 5usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).nb_pool_maps as *const _ as usize },
+ 6usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(nb_pool_maps)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).pool_map as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(pool_map)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_conf)).dcb_tc as *const _ as usize },
+ 1032usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_dcb_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -838,27 +953,46 @@ pub struct rte_eth_dcb_rx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_rx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_dcb_rx_conf>() , 12usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_dcb_rx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_dcb_rx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_rx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_rx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_dcb_rx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_dcb_rx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_dcb_rx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_dcb_rx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).nb_tcs as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_rx_conf),
+ "::",
+ stringify!(nb_tcs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_rx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_rx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_dcb_rx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_dcb_rx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -870,29 +1004,46 @@ pub struct rte_eth_vmdq_dcb_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>() , 12usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) .
- nb_queue_pools as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! (
- nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_dcb_tx_conf ) ) . dcb_tc as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_dcb_tx_conf ) , "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_dcb_tx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_dcb_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_dcb_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_dcb_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_tx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_dcb_tx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_dcb_tx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_vmdq_dcb_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_dcb_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -904,27 +1055,46 @@ pub struct rte_eth_dcb_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_dcb_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_dcb_tx_conf>() , 12usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_dcb_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_dcb_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . nb_tcs as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( nb_tcs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_dcb_tx_conf ) ) . dcb_tc as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_dcb_tx_conf ) ,
- "::" , stringify ! ( dcb_tc ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_dcb_tx_conf>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_dcb_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_dcb_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_dcb_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).nb_tcs as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_tx_conf),
+ "::",
+ stringify!(nb_tcs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_dcb_tx_conf)).dcb_tc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_dcb_tx_conf),
+ "::",
+ stringify!(dcb_tc)
+ )
+ );
}
impl Clone for rte_eth_dcb_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_dcb_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -934,22 +1104,36 @@ pub struct rte_eth_vmdq_tx_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_tx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_tx_conf>() , 4usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_tx_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_tx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_tx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_tx_conf>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_tx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_tx_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_tx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_tx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_tx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_tx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_tx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -979,80 +1163,139 @@ pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
- 16usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_vmdq_rx_conf__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- vlan_id as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vlan_id ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf__bindgen_ty_1 ) ) .
- pools as * const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_vmdq_rx_conf__bindgen_ty_1 ) , "::" , stringify ! (
- pools ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
+ 16usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_rx_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).vlan_id as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1),
+ "::",
+ stringify!(vlan_id)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf__bindgen_ty_1)).pools as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf__bindgen_ty_1),
+ "::",
+ stringify!(pools)
+ )
+ );
}
impl Clone for rte_eth_vmdq_rx_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_vmdq_rx_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_vmdq_rx_conf>() , 1040usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_vmdq_rx_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_vmdq_rx_conf>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_vmdq_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_queue_pools
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_queue_pools ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_default_pool as * const _ as usize } , 4usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . default_pool
- as * const _ as usize } , 5usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( default_pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) .
- enable_loop_back as * const _ as usize } , 6usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( enable_loop_back ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . nb_pool_maps
- as * const _ as usize } , 7usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( nb_pool_maps ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . rx_mode as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( rx_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_vmdq_rx_conf ) ) . pool_map as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_vmdq_rx_conf )
- , "::" , stringify ! ( pool_map ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_vmdq_rx_conf>(),
+ 1040usize,
+ concat!("Size of: ", stringify!(rte_eth_vmdq_rx_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_vmdq_rx_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_vmdq_rx_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_queue_pools as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(nb_queue_pools)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_default_pool as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(enable_default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).default_pool as *const _ as usize },
+ 5usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(default_pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).enable_loop_back as *const _ as usize },
+ 6usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(enable_loop_back)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).nb_pool_maps as *const _ as usize },
+ 7usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(nb_pool_maps)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).rx_mode as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(rx_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_vmdq_rx_conf)).pool_map as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_vmdq_rx_conf),
+ "::",
+ stringify!(pool_map)
+ )
+ );
}
impl Clone for rte_eth_vmdq_rx_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_vmdq_rx_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(u32)]
/// Flow Director setting modes: none, signature or perfect.
@@ -1098,38 +1341,71 @@ pub struct rte_eth_ipv4_flow {
}
#[test]
fn bindgen_test_layout_rte_eth_ipv4_flow() {
- assert_eq!(::std::mem::size_of::<rte_eth_ipv4_flow>() , 12usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_ipv4_flow ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_ipv4_flow>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_ipv4_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . dst_ip as * const
- _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . tos as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( tos ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . ttl as * const _
- as usize } , 9usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( ttl ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv4_flow ) ) . proto as * const
- _ as usize } , 10usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv4_flow ) ,
- "::" , stringify ! ( proto ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_ipv4_flow>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_ipv4_flow))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_ipv4_flow>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_ipv4_flow))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).src_ip as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(src_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).dst_ip as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(dst_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).tos as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(tos)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).ttl as *const _ as usize },
+ 9usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(ttl)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv4_flow)).proto as *const _ as usize },
+ 10usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv4_flow),
+ "::",
+ stringify!(proto)
+ )
+ );
}
impl Clone for rte_eth_ipv4_flow {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to define the input for IPV6 flow
#[repr(C)]
@@ -1148,38 +1424,71 @@ pub struct rte_eth_ipv6_flow {
}
#[test]
fn bindgen_test_layout_rte_eth_ipv6_flow() {
- assert_eq!(::std::mem::size_of::<rte_eth_ipv6_flow>() , 36usize , concat !
- ( "Size of: " , stringify ! ( rte_eth_ipv6_flow ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_ipv6_flow>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_ipv6_flow ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . src_ip as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( src_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . dst_ip as * const
- _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( dst_ip ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . tc as * const _
- as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( tc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . proto as * const
- _ as usize } , 33usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( proto ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_ipv6_flow ) ) . hop_limits as *
- const _ as usize } , 34usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_ipv6_flow ) ,
- "::" , stringify ! ( hop_limits ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_ipv6_flow>(),
+ 36usize,
+ concat!("Size of: ", stringify!(rte_eth_ipv6_flow))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_ipv6_flow>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_ipv6_flow))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).src_ip as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(src_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).dst_ip as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(dst_ip)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).tc as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(tc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).proto as *const _ as usize },
+ 33usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(proto)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_ipv6_flow)).hop_limits as *const _ as usize },
+ 34usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_ipv6_flow),
+ "::",
+ stringify!(hop_limits)
+ )
+ );
}
impl Clone for rte_eth_ipv6_flow {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to configure FDIR masks that are used by the device
/// to match the various fields of RX packet headers.
@@ -1207,54 +1516,101 @@ pub struct rte_eth_fdir_masks {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_masks() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_masks>() , 68usize , concat
- ! ( "Size of: " , stringify ! ( rte_eth_fdir_masks ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_masks>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( rte_eth_fdir_masks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . vlan_tci_mask as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( vlan_tci_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv4_mask as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv4_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . ipv6_mask as *
- const _ as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( ipv6_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . src_port_mask as
- * const _ as usize } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( src_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . dst_port_mask as
- * const _ as usize } , 54usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( dst_port_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) .
- mac_addr_byte_mask as * const _ as usize } , 56usize , concat
- ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( mac_addr_byte_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_id_mask
- as * const _ as usize } , 60usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_id_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_masks ) ) . tunnel_type_mask
- as * const _ as usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_masks ) ,
- "::" , stringify ! ( tunnel_type_mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_masks>(),
+ 68usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_masks))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_masks>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_masks))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).vlan_tci_mask as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(vlan_tci_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv4_mask as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(ipv4_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).ipv6_mask as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(ipv6_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).src_port_mask as *const _ as usize },
+ 52usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(src_port_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).dst_port_mask as *const _ as usize },
+ 54usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(dst_port_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).mac_addr_byte_mask as *const _ as usize },
+ 56usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(mac_addr_byte_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_id_mask as *const _ as usize },
+ 60usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(tunnel_id_mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_masks)).tunnel_type_mask as *const _ as usize },
+ 64usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_masks),
+ "::",
+ stringify!(tunnel_type_mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_masks {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(u32)]
/// Payload type
@@ -1278,29 +1634,46 @@ pub struct rte_eth_flex_payload_cfg {
}
#[test]
fn bindgen_test_layout_rte_eth_flex_payload_cfg() {
- assert_eq!(::std::mem::size_of::<rte_eth_flex_payload_cfg>() , 36usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_flex_payload_cfg ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_flex_payload_cfg>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_flex_payload_cfg ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . type_ as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( type_ ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_flex_payload_cfg ) ) . src_offset
- as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_flex_payload_cfg ) , "::" , stringify ! ( src_offset )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_flex_payload_cfg>(),
+ 36usize,
+ concat!("Size of: ", stringify!(rte_eth_flex_payload_cfg))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_flex_payload_cfg>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_flex_payload_cfg))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).type_ as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_flex_payload_cfg),
+ "::",
+ stringify!(type_)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_flex_payload_cfg)).src_offset as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_flex_payload_cfg),
+ "::",
+ stringify!(src_offset)
+ )
+ );
}
impl Clone for rte_eth_flex_payload_cfg {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_flex_payload_cfg {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to define FDIR masks for flexible payload
/// for each flow type
@@ -1312,25 +1685,41 @@ pub struct rte_eth_fdir_flex_mask {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_mask() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_mask>() , 18usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_mask )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_mask>() , 2usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_fdir_flex_mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . flow_type as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( flow_type ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_mask ) ) . mask as *
- const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_mask
- ) , "::" , stringify ! ( mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_flex_mask>(),
+ 18usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_flex_mask))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_flex_mask>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_flex_mask))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).flow_type as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_mask),
+ "::",
+ stringify!(flow_type)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_mask)).mask as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_mask),
+ "::",
+ stringify!(mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_flex_mask {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to define all flexible payload related setting
/// include flex payload and flex mask
@@ -1346,38 +1735,66 @@ pub struct rte_eth_fdir_flex_conf {
}
#[test]
fn bindgen_test_layout_rte_eth_fdir_flex_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_fdir_flex_conf>() , 688usize ,
- concat ! ( "Size of: " , stringify ! ( rte_eth_fdir_flex_conf )
- ));
- assert_eq! (::std::mem::align_of::<rte_eth_fdir_flex_conf>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_eth_fdir_flex_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_payloads
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_payloads ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . nb_flexmasks
- as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( nb_flexmasks ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_set as
- * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_set ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_fdir_flex_conf ) ) . flex_mask as
- * const _ as usize } , 292usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_fdir_flex_conf
- ) , "::" , stringify ! ( flex_mask ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_fdir_flex_conf>(),
+ 688usize,
+ concat!("Size of: ", stringify!(rte_eth_fdir_flex_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_fdir_flex_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_fdir_flex_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_payloads as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(nb_payloads)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).nb_flexmasks as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(nb_flexmasks)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_set as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(flex_set)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_fdir_flex_conf)).flex_mask as *const _ as usize },
+ 292usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_fdir_flex_conf),
+ "::",
+ stringify!(flex_mask)
+ )
+ );
}
impl Clone for rte_eth_fdir_flex_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_fdir_flex_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to configure the Flow Director (FDIR) feature
/// of an Ethernet port.
@@ -1399,46 +1816,86 @@ pub struct rte_fdir_conf {
}
#[test]
fn bindgen_test_layout_rte_fdir_conf() {
- assert_eq!(::std::mem::size_of::<rte_fdir_conf>() , 772usize , concat ! (
- "Size of: " , stringify ! ( rte_fdir_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_fdir_conf>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( rte_fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mode as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . pballoc as * const _
- as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( pballoc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . status as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( status ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . drop_queue as * const
- _ as usize } , 12usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( drop_queue ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . mask as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( mask ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_fdir_conf ) ) . flex_conf as * const
- _ as usize } , 84usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_fdir_conf ) , "::"
- , stringify ! ( flex_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_fdir_conf>(),
+ 772usize,
+ concat!("Size of: ", stringify!(rte_fdir_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_fdir_conf>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_fdir_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).mode as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).pballoc as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(pballoc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).status as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(status)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).drop_queue as *const _ as usize },
+ 12usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(drop_queue)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).mask as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(mask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_fdir_conf)).flex_conf as *const _ as usize },
+ 84usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_fdir_conf),
+ "::",
+ stringify!(flex_conf)
+ )
+ );
}
impl Clone for rte_fdir_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_fdir_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// A structure used to enable/disable specific device interrupts.
#[repr(C)]
@@ -1451,23 +1908,41 @@ pub struct rte_intr_conf {
}
#[test]
fn bindgen_test_layout_rte_intr_conf() {
- assert_eq!(::std::mem::size_of::<rte_intr_conf>() , 4usize , concat ! (
- "Size of: " , stringify ! ( rte_intr_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_intr_conf>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( rte_intr_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . lsc as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( lsc ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_intr_conf ) ) . rxq as * const _ as
- usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_intr_conf ) , "::"
- , stringify ! ( rxq ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_intr_conf>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_intr_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_intr_conf>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_intr_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_intr_conf)).lsc as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_intr_conf),
+ "::",
+ stringify!(lsc)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_intr_conf)).rxq as *const _ as usize },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_intr_conf),
+ "::",
+ stringify!(rxq)
+ )
+ );
}
impl Clone for rte_intr_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// A structure used to configure an Ethernet port.
/// Depending upon the RX multi-queue mode, extra advanced
@@ -1516,43 +1991,66 @@ pub struct rte_eth_conf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>() , 2120usize
- , concat ! (
- "Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>() , 8usize
- , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_1 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) . rss_conf
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! ( rss_conf )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_dcb_conf as * const _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_dcb_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- dcb_rx_conf as * const _ as usize } , 1064usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- dcb_rx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_1 ) ) .
- vmdq_rx_conf as * const _ as usize } , 1080usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_1 ) , "::" , stringify ! (
- vmdq_rx_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf__bindgen_ty_1>(),
+ 2120usize,
+ concat!("Size of: ", stringify!(rte_eth_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf__bindgen_ty_1>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).rss_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(rss_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_dcb_conf as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(vmdq_dcb_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).dcb_rx_conf as *const _ as usize },
+ 1064usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(dcb_rx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_1)).vmdq_rx_conf as *const _ as usize },
+ 1080usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_1),
+ "::",
+ stringify!(vmdq_rx_conf)
+ )
+ );
}
impl Clone for rte_eth_conf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_conf__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -1564,90 +2062,164 @@ pub struct rte_eth_conf__bindgen_ty_2 {
}
#[test]
fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>() , 12usize ,
- concat ! (
- "Size of: " , stringify ! ( rte_eth_conf__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf__bindgen_ty_2 )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- dcb_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- dcb_tx_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf__bindgen_ty_2 ) ) .
- vmdq_tx_conf as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_eth_conf__bindgen_ty_2 ) , "::" , stringify ! (
- vmdq_tx_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf__bindgen_ty_2>(),
+ 12usize,
+ concat!("Size of: ", stringify!(rte_eth_conf__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_dcb_tx_conf as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(vmdq_dcb_tx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).dcb_tx_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(dcb_tx_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf__bindgen_ty_2)).vmdq_tx_conf as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf__bindgen_ty_2),
+ "::",
+ stringify!(vmdq_tx_conf)
+ )
+ );
}
impl Clone for rte_eth_conf__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_eth_conf() {
- assert_eq!(::std::mem::size_of::<rte_eth_conf>() , 2944usize , concat ! (
- "Size of: " , stringify ! ( rte_eth_conf ) ));
- assert_eq! (::std::mem::align_of::<rte_eth_conf>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( rte_eth_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . link_speeds as * const
- _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( link_speeds ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rxmode as * const _ as
- usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rxmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . txmode as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( txmode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . lpbk_mode as * const _
- as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( lpbk_mode ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . rx_adv_conf as * const
- _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( rx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . tx_adv_conf as * const
- _ as usize } , 2152usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( tx_adv_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . dcb_capability_en as *
- const _ as usize } , 2164usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( dcb_capability_en ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . fdir_conf as * const _
- as usize } , 2168usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( fdir_conf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_eth_conf ) ) . intr_conf as * const _
- as usize } , 2940usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_eth_conf ) , "::" ,
- stringify ! ( intr_conf ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_eth_conf>(),
+ 2944usize,
+ concat!("Size of: ", stringify!(rte_eth_conf))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_eth_conf>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_eth_conf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).link_speeds as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(link_speeds)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).rxmode as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(rxmode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).txmode as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(txmode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).lpbk_mode as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(lpbk_mode)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).rx_adv_conf as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(rx_adv_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).tx_adv_conf as *const _ as usize },
+ 2152usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(tx_adv_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).dcb_capability_en as *const _ as usize },
+ 2164usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(dcb_capability_en)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).fdir_conf as *const _ as usize },
+ 2168usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(fdir_conf)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_eth_conf)).intr_conf as *const _ as usize },
+ 2940usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_eth_conf),
+ "::",
+ stringify!(intr_conf)
+ )
+ );
}
impl Clone for rte_eth_conf {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_eth_conf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/layout_mbuf.rs b/tests/expectations/tests/layout_mbuf.rs
index 63cd92bb..a671db6c 100644
--- a/tests/expectations/tests/layout_mbuf.rs
+++ b/tests/expectations/tests/layout_mbuf.rs
@@ -19,18 +19,31 @@ pub struct rte_atomic16_t {
}
#[test]
fn bindgen_test_layout_rte_atomic16_t() {
- assert_eq!(::std::mem::size_of::<rte_atomic16_t>() , 2usize , concat ! (
- "Size of: " , stringify ! ( rte_atomic16_t ) ));
- assert_eq! (::std::mem::align_of::<rte_atomic16_t>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( rte_atomic16_t ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_atomic16_t ) ) . cnt as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_atomic16_t ) , "::"
- , stringify ! ( cnt ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_atomic16_t>(),
+ 2usize,
+ concat!("Size of: ", stringify!(rte_atomic16_t))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_atomic16_t>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_atomic16_t))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_atomic16_t)).cnt as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_atomic16_t),
+ "::",
+ stringify!(cnt)
+ )
+ );
}
impl Clone for rte_atomic16_t {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// The generic rte_mbuf, containing a packet mbuf.
#[repr(C)]
@@ -96,28 +109,46 @@ pub union rte_mbuf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_1 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) .
- refcnt_atomic as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt_atomic ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) . refcnt as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_1>(),
+ 2usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_1>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt_atomic as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_1),
+ "::",
+ stringify!(refcnt_atomic)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_1),
+ "::",
+ stringify!(refcnt)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -135,28 +166,38 @@ pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>() ,
- 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
#[inline]
pub fn l2_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -168,31 +209,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn l3_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 240u64 as u32;
let val = (unit_field_val & mask) >> 4usize;
@@ -204,31 +245,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn l4_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 3840u64 as u32;
let val = (unit_field_val & mask) >> 8usize;
@@ -240,31 +281,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn tun_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 61440u64 as u32;
let val = (unit_field_val & mask) >> 12usize;
@@ -276,31 +317,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 12usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l2_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 983040u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -312,31 +353,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l3_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15728640u64 as u32;
let val = (unit_field_val & mask) >> 20usize;
@@ -348,31 +389,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 20usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l4_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 251658240u64 as u32;
let val = (unit_field_val & mask) >> 24usize;
@@ -384,74 +425,73 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(l2_type: u32, l3_type: u32, l4_type: u32,
- tun_type: u32, inner_l2_type: u32,
- inner_l3_type: u32, inner_l4_type: u32) -> u32 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((l2_type as u32 as u32) << 0usize)
- & (15u64 as u32))
- } |
- ((l3_type as u32 as u32) << 4usize) &
- (240u64 as u32))
- } |
- ((l4_type as u32 as u32) << 8usize) &
- (3840u64 as u32))
- } |
- ((tun_type as u32 as u32) << 12usize) &
- (61440u64 as u32))
- } |
- ((inner_l2_type as u32 as u32) << 16usize) &
- (983040u64 as u32))
- } |
- ((inner_l3_type as u32 as u32) << 20usize) &
- (15728640u64 as u32))
- } |
- ((inner_l4_type as u32 as u32) << 24usize) &
- (251658240u64 as u32))
+ pub fn new_bitfield_1(
+ l2_type: u32,
+ l3_type: u32,
+ l4_type: u32,
+ tun_type: u32,
+ inner_l2_type: u32,
+ inner_l3_type: u32,
+ inner_l4_type: u32,
+ ) -> u32 {
+ (((((((0 | ((l2_type as u32 as u32) << 0usize) & (15u64 as u32)) |
+ ((l3_type as u32 as u32) << 4usize) & (240u64 as u32)) |
+ ((l4_type as u32 as u32) << 8usize) & (3840u64 as u32)) |
+ ((tun_type as u32 as u32) << 12usize) & (61440u64 as u32)) |
+ ((inner_l2_type as u32 as u32) << 16usize) & (983040u64 as u32)) |
+ ((inner_l3_type as u32 as u32) << 20usize) & (15728640u64 as u32)) |
+ ((inner_l4_type as u32 as u32) << 24usize) & (251658240u64 as u32))
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_2 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_2 ) ) . packet_type
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_2
- ) , "::" , stringify ! ( packet_type ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_2)).packet_type as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_2),
+ "::",
+ stringify!(packet_type)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_2 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -487,87 +527,134 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
- , 2usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . hash as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . id as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( id ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
+ 2usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1))
+ .hash as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(hash)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)).id as
+ *const _ as usize
+ },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(id)
+ )
+ );
}
-impl Clone for
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ) . lo as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( lo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)).lo as *const _ as
+ usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(lo)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) , "::" , stringify ! (
- hi ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1)).hi as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1),
+ "::",
+ stringify!(hi)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -577,64 +664,110 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . lo as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- lo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- hi ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).lo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2),
+ "::",
+ stringify!(lo)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).hi as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2),
+ "::",
+ stringify!(hi)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_3 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . rss as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( rss ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . fdir as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( fdir ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . sched as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( sched ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . usr as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( usr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_3))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_3))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).rss as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(rss)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).fdir as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(fdir)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).sched as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(sched)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).usr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(usr)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_3 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -647,28 +780,46 @@ pub union rte_mbuf__bindgen_ty_4 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_4 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . userdata as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( userdata ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . udata64 as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( udata64 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_4>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_4))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_4>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_4))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).userdata as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_4),
+ "::",
+ stringify!(userdata)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).udata64 as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_4),
+ "::",
+ stringify!(udata64)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_4 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_4 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Copy)]
@@ -686,28 +837,38 @@ pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>()
- , 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_5__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_5__bindgen_ty_1)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
#[inline]
pub fn l2_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 127u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -719,31 +880,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn l3_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 65408u64 as u64;
let val = (unit_field_val & mask) >> 7usize;
@@ -755,31 +916,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn l4_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 16711680u64 as u64;
let val = (unit_field_val & mask) >> 16usize;
@@ -791,31 +952,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn tso_segsz(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1099494850560u64 as u64;
let val = (unit_field_val & mask) >> 24usize;
@@ -827,31 +988,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn outer_l3_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 561850441793536u64 as u64;
let val = (unit_field_val & mask) >> 40usize;
@@ -863,31 +1024,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 40usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn outer_l2_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 71494644084506624u64 as u64;
let val = (unit_field_val & mask) >> 49usize;
@@ -899,183 +1060,294 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 49usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(l2_len: u64, l3_len: u64, l4_len: u64,
- tso_segsz: u64, outer_l3_len: u64,
- outer_l2_len: u64) -> u64 {
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((l2_len as u64 as u64) << 0usize) &
- (127u64 as u64))
- } |
- ((l3_len as u64 as u64) << 7usize) &
- (65408u64 as u64))
- } |
- ((l4_len as u64 as u64) << 16usize) &
- (16711680u64 as u64))
- } |
- ((tso_segsz as u64 as u64) << 24usize) &
- (1099494850560u64 as u64))
- } |
- ((outer_l3_len as u64 as u64) << 40usize) &
- (561850441793536u64 as u64))
- } |
- ((outer_l2_len as u64 as u64) << 49usize) &
- (71494644084506624u64 as u64))
+ pub fn new_bitfield_1(
+ l2_len: u64,
+ l3_len: u64,
+ l4_len: u64,
+ tso_segsz: u64,
+ outer_l3_len: u64,
+ outer_l2_len: u64,
+ ) -> u64 {
+ ((((((0 | ((l2_len as u64 as u64) << 0usize) & (127u64 as u64)) |
+ ((l3_len as u64 as u64) << 7usize) & (65408u64 as u64)) |
+ ((l4_len as u64 as u64) << 16usize) & (16711680u64 as u64)) |
+ ((tso_segsz as u64 as u64) << 24usize) & (1099494850560u64 as u64)) |
+ ((outer_l3_len as u64 as u64) << 40usize) & (561850441793536u64 as u64)) |
+ ((outer_l2_len as u64 as u64) << 49usize) & (71494644084506624u64 as u64))
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_5 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_5 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_5 ) ) . tx_offload
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_5
- ) , "::" , stringify ! ( tx_offload ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_5>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_5))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_5>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_5))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_5)).tx_offload as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_5),
+ "::",
+ stringify!(tx_offload)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_5 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for rte_mbuf__bindgen_ty_5 {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf() {
- assert_eq!(::std::mem::size_of::<rte_mbuf>() , 128usize , concat ! (
- "Size of: " , stringify ! ( rte_mbuf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline0 as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline0 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_addr as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_physaddr as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_physaddr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_len as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rearm_data as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rearm_data ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_off as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_off ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . nb_segs as * const _ as
- usize } , 22usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( nb_segs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . port as * const _ as usize
- } , 23usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( port ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . ol_flags as * const _ as
- usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( ol_flags ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rx_descriptor_fields1 as *
- const _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rx_descriptor_fields1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pkt_len as * const _ as
- usize } , 36usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_len as * const _ as
- usize } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci as * const _ as
- usize } , 42usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . hash as * const _ as usize
- } , 44usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . seqn as * const _ as usize
- } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( seqn ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci_outer as * const
- _ as usize } , 56usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci_outer ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline1 as * const _ as
- usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pool as * const _ as usize
- } , 72usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . next as * const _ as usize
- } , 80usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( next ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . priv_size as * const _ as
- usize } , 96usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( priv_size ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . timesync as * const _ as
- usize } , 98usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( timesync ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf>(),
+ 128usize,
+ concat!("Size of: ", stringify!(rte_mbuf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).cacheline0 as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(cacheline0)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_addr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_addr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_physaddr as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_physaddr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_len as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).rearm_data as *const _ as usize },
+ 18usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(rearm_data)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).data_off as *const _ as usize },
+ 18usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(data_off)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).nb_segs as *const _ as usize },
+ 22usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(nb_segs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).port as *const _ as usize },
+ 23usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(port)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).ol_flags as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(ol_flags)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).rx_descriptor_fields1 as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(rx_descriptor_fields1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).pkt_len as *const _ as usize },
+ 36usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(pkt_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).data_len as *const _ as usize },
+ 40usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(data_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).vlan_tci as *const _ as usize },
+ 42usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(vlan_tci)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).hash as *const _ as usize },
+ 44usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(hash)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).seqn as *const _ as usize },
+ 52usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(seqn)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).vlan_tci_outer as *const _ as usize },
+ 56usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(vlan_tci_outer)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).cacheline1 as *const _ as usize },
+ 64usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(cacheline1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).pool as *const _ as usize },
+ 72usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).next as *const _ as usize },
+ 80usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(next)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).priv_size as *const _ as usize },
+ 96usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(priv_size)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).timesync as *const _ as usize },
+ 98usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(timesync)
+ )
+ );
}
impl Default for rte_mbuf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// < Pool from which mbuf was allocated.
#[repr(C)]
@@ -1084,5 +1356,7 @@ pub struct rte_mempool {
pub _address: u8,
}
impl Clone for rte_mempool {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/layout_mbuf_1_0.rs b/tests/expectations/tests/layout_mbuf_1_0.rs
index b9c6e69b..fe947a3a 100644
--- a/tests/expectations/tests/layout_mbuf_1_0.rs
+++ b/tests/expectations/tests/layout_mbuf_1_0.rs
@@ -6,33 +6,45 @@
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl <T> __BindgenUnionField<T> {
+impl<T> __BindgenUnionField<T> {
#[inline]
- pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
+ pub fn new() -> Self {
+ __BindgenUnionField(::std::marker::PhantomData)
+ }
#[inline]
- pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
+ pub unsafe fn as_ref(&self) -> &T {
+ ::std::mem::transmute(self)
+ }
#[inline]
- pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
+ pub unsafe fn as_mut(&mut self) -> &mut T {
+ ::std::mem::transmute(self)
+ }
}
-impl <T> ::std::default::Default for __BindgenUnionField<T> {
+impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
- fn default() -> Self { Self::new() }
+ fn default() -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
+impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
- fn clone(&self) -> Self { Self::new() }
+ fn clone(&self) -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
-impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
+impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
+impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
-impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
- fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
+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 }
+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;
@@ -50,18 +62,31 @@ pub struct rte_atomic16_t {
}
#[test]
fn bindgen_test_layout_rte_atomic16_t() {
- assert_eq!(::std::mem::size_of::<rte_atomic16_t>() , 2usize , concat ! (
- "Size of: " , stringify ! ( rte_atomic16_t ) ));
- assert_eq! (::std::mem::align_of::<rte_atomic16_t>() , 2usize , concat ! (
- "Alignment of " , stringify ! ( rte_atomic16_t ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_atomic16_t ) ) . cnt as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_atomic16_t ) , "::"
- , stringify ! ( cnt ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_atomic16_t>(),
+ 2usize,
+ concat!("Size of: ", stringify!(rte_atomic16_t))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_atomic16_t>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_atomic16_t))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_atomic16_t)).cnt as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_atomic16_t),
+ "::",
+ stringify!(cnt)
+ )
+ );
}
impl Clone for rte_atomic16_t {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// The generic rte_mbuf, containing a packet mbuf.
#[repr(C)]
@@ -127,25 +152,41 @@ pub struct rte_mbuf__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_1 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_1>() , 2usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) .
- refcnt_atomic as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt_atomic ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_1 ) ) . refcnt as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_1
- ) , "::" , stringify ! ( refcnt ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_1>(),
+ 2usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_1>(),
+ 2usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt_atomic as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_1),
+ "::",
+ stringify!(refcnt_atomic)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_1)).refcnt as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_1),
+ "::",
+ stringify!(refcnt)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -163,28 +204,38 @@ pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>() ,
- 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_2__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_2__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_2__bindgen_ty_1)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
#[inline]
pub fn l2_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -196,31 +247,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn l3_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 240u64 as u32;
let val = (unit_field_val & mask) >> 4usize;
@@ -232,31 +283,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 4usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn l4_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 3840u64 as u32;
let val = (unit_field_val & mask) >> 8usize;
@@ -268,31 +319,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn tun_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 61440u64 as u32;
let val = (unit_field_val & mask) >> 12usize;
@@ -304,31 +355,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 12usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l2_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 983040u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -340,31 +391,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l3_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 15728640u64 as u32;
let val = (unit_field_val & mask) >> 20usize;
@@ -376,31 +427,31 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 20usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn inner_l4_type(&self) -> u32 {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 251658240u64 as u32;
let val = (unit_field_val & mask) >> 24usize;
@@ -412,71 +463,68 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(l2_type: u32, l3_type: u32, l4_type: u32,
- tun_type: u32, inner_l2_type: u32,
- inner_l3_type: u32, inner_l4_type: u32) -> u32 {
- ({
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((l2_type as u32 as u32) << 0usize)
- & (15u64 as u32))
- } |
- ((l3_type as u32 as u32) << 4usize) &
- (240u64 as u32))
- } |
- ((l4_type as u32 as u32) << 8usize) &
- (3840u64 as u32))
- } |
- ((tun_type as u32 as u32) << 12usize) &
- (61440u64 as u32))
- } |
- ((inner_l2_type as u32 as u32) << 16usize) &
- (983040u64 as u32))
- } |
- ((inner_l3_type as u32 as u32) << 20usize) &
- (15728640u64 as u32))
- } |
- ((inner_l4_type as u32 as u32) << 24usize) &
- (251658240u64 as u32))
+ pub fn new_bitfield_1(
+ l2_type: u32,
+ l3_type: u32,
+ l4_type: u32,
+ tun_type: u32,
+ inner_l2_type: u32,
+ inner_l3_type: u32,
+ inner_l4_type: u32,
+ ) -> u32 {
+ (((((((0 | ((l2_type as u32 as u32) << 0usize) & (15u64 as u32)) |
+ ((l3_type as u32 as u32) << 4usize) & (240u64 as u32)) |
+ ((l4_type as u32 as u32) << 8usize) & (3840u64 as u32)) |
+ ((tun_type as u32 as u32) << 12usize) & (61440u64 as u32)) |
+ ((inner_l2_type as u32 as u32) << 16usize) & (983040u64 as u32)) |
+ ((inner_l3_type as u32 as u32) << 20usize) & (15728640u64 as u32)) |
+ ((inner_l4_type as u32 as u32) << 24usize) & (251658240u64 as u32))
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_2 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_2>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_2 ) ) . packet_type
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_2
- ) , "::" , stringify ! ( packet_type ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_2))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_2>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_2))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_2)).packet_type as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_2),
+ "::",
+ stringify!(packet_type)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -500,7 +548,8 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
#[repr(C)]
#[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 __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,
}
@@ -512,81 +561,124 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>()
- , 2usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . hash as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) ) . id as * const _ as usize } , 2usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1
- ) , "::" , stringify ! ( id ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
+ 2usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1))
+ .hash as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(hash)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)).id as
+ *const _ as usize
+ },
+ 2usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(id)
+ )
+ );
}
-impl Clone for
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & (
- * (
- 0 as * const
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) ) . lo as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 ) , "::" ,
- stringify ! ( lo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1)).lo as *const _ as
+ usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(lo)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_1 ) , "::" , stringify ! (
- hi ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_1)).hi as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1),
+ "::",
+ stringify!(hi)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -596,61 +688,105 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . lo as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- lo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) )
- . hi as * const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! (
- rte_mbuf__bindgen_ty_3__bindgen_ty_2 ) , "::" , stringify ! (
- hi ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>(),
+ 4usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).lo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2),
+ "::",
+ stringify!(lo)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3__bindgen_ty_2)).hi as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_2),
+ "::",
+ stringify!(hi)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_3>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_3 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_3>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_3 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . rss as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( rss ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . fdir as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( fdir ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . sched as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( sched ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_3 ) ) . usr as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_3
- ) , "::" , stringify ! ( usr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_3>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_3))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_3>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_3))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).rss as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(rss)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).fdir as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(fdir)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).sched as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(sched)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_3)).usr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_3),
+ "::",
+ stringify!(usr)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_3 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -663,25 +799,41 @@ pub struct rte_mbuf__bindgen_ty_4 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_4 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_4>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_4 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . userdata as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( userdata ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_4 ) ) . udata64 as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_4
- ) , "::" , stringify ! ( udata64 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_4>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_4))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_4>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_4))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).userdata as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_4),
+ "::",
+ stringify!(userdata)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_4)).udata64 as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_4),
+ "::",
+ stringify!(udata64)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_4 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -699,28 +851,38 @@ pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>() ,
- 8usize , concat ! (
- "Size of: " , stringify ! (
- rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>()
- , 8usize , concat ! (
- "Alignment of " , stringify ! (
- rte_mbuf__bindgen_ty_5__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Size of: ",
+ stringify!(rte_mbuf__bindgen_ty_5__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_5__bindgen_ty_1>(),
+ 8usize,
+ concat!(
+ "Alignment of ",
+ stringify!(rte_mbuf__bindgen_ty_5__bindgen_ty_1)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
#[inline]
pub fn l2_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 127u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -732,31 +894,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn l3_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 65408u64 as u64;
let val = (unit_field_val & mask) >> 7usize;
@@ -768,31 +930,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn l4_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 16711680u64 as u64;
let val = (unit_field_val & mask) >> 16usize;
@@ -804,31 +966,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn tso_segsz(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 1099494850560u64 as u64;
let val = (unit_field_val & mask) >> 24usize;
@@ -840,31 +1002,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 24usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn outer_l3_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 561850441793536u64 as u64;
let val = (unit_field_val & mask) >> 40usize;
@@ -876,31 +1038,31 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 40usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn outer_l2_len(&self) -> u64 {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 71494644084506624u64 as u64;
let val = (unit_field_val & mask) >> 49usize;
@@ -912,180 +1074,289 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
let val = val as u64 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 49usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(l2_len: u64, l3_len: u64, l4_len: u64,
- tso_segsz: u64, outer_l3_len: u64,
- outer_l2_len: u64) -> u64 {
- ({
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((l2_len as u64 as u64) << 0usize) &
- (127u64 as u64))
- } |
- ((l3_len as u64 as u64) << 7usize) &
- (65408u64 as u64))
- } |
- ((l4_len as u64 as u64) << 16usize) &
- (16711680u64 as u64))
- } |
- ((tso_segsz as u64 as u64) << 24usize) &
- (1099494850560u64 as u64))
- } |
- ((outer_l3_len as u64 as u64) << 40usize) &
- (561850441793536u64 as u64))
- } |
- ((outer_l2_len as u64 as u64) << 49usize) &
- (71494644084506624u64 as u64))
+ pub fn new_bitfield_1(
+ l2_len: u64,
+ l3_len: u64,
+ l4_len: u64,
+ tso_segsz: u64,
+ outer_l3_len: u64,
+ outer_l2_len: u64,
+ ) -> u64 {
+ ((((((0 | ((l2_len as u64 as u64) << 0usize) & (127u64 as u64)) |
+ ((l3_len as u64 as u64) << 7usize) & (65408u64 as u64)) |
+ ((l4_len as u64 as u64) << 16usize) & (16711680u64 as u64)) |
+ ((tso_segsz as u64 as u64) << 24usize) & (1099494850560u64 as u64)) |
+ ((outer_l3_len as u64 as u64) << 40usize) & (561850441793536u64 as u64)) |
+ ((outer_l2_len as u64 as u64) << 49usize) & (71494644084506624u64 as u64))
}
}
#[test]
fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() {
- assert_eq!(::std::mem::size_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( rte_mbuf__bindgen_ty_5 )
- ));
- assert_eq! (::std::mem::align_of::<rte_mbuf__bindgen_ty_5>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( rte_mbuf__bindgen_ty_5 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf__bindgen_ty_5 ) ) . tx_offload
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf__bindgen_ty_5
- ) , "::" , stringify ! ( tx_offload ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf__bindgen_ty_5>(),
+ 8usize,
+ concat!("Size of: ", stringify!(rte_mbuf__bindgen_ty_5))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<rte_mbuf__bindgen_ty_5>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_5))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf__bindgen_ty_5)).tx_offload as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf__bindgen_ty_5),
+ "::",
+ stringify!(tx_offload)
+ )
+ );
}
impl Clone for rte_mbuf__bindgen_ty_5 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn bindgen_test_layout_rte_mbuf() {
- assert_eq!(::std::mem::size_of::<rte_mbuf>() , 128usize , concat ! (
- "Size of: " , stringify ! ( rte_mbuf ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline0 as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline0 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_addr as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_addr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_physaddr as * const _
- as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_physaddr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . buf_len as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( buf_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rearm_data as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rearm_data ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_off as * const _ as
- usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_off ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . nb_segs as * const _ as
- usize } , 22usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( nb_segs ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . port as * const _ as usize
- } , 23usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( port ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . ol_flags as * const _ as
- usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( ol_flags ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . rx_descriptor_fields1 as *
- const _ as usize } , 32usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( rx_descriptor_fields1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pkt_len as * const _ as
- usize } , 36usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pkt_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . data_len as * const _ as
- usize } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( data_len ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci as * const _ as
- usize } , 42usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . hash as * const _ as usize
- } , 44usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( hash ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . seqn as * const _ as usize
- } , 52usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( seqn ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . vlan_tci_outer as * const
- _ as usize } , 56usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( vlan_tci_outer ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . cacheline1 as * const _ as
- usize } , 64usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( cacheline1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . pool as * const _ as usize
- } , 72usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( pool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . next as * const _ as usize
- } , 80usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( next ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . priv_size as * const _ as
- usize } , 96usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( priv_size ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const rte_mbuf ) ) . timesync as * const _ as
- usize } , 98usize , concat ! (
- "Alignment of field: " , stringify ! ( rte_mbuf ) , "::" ,
- stringify ! ( timesync ) ));
+ assert_eq!(
+ ::std::mem::size_of::<rte_mbuf>(),
+ 128usize,
+ concat!("Size of: ", stringify!(rte_mbuf))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).cacheline0 as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(cacheline0)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_addr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_addr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_physaddr as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_physaddr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).buf_len as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(buf_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).rearm_data as *const _ as usize },
+ 18usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(rearm_data)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).data_off as *const _ as usize },
+ 18usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(data_off)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).nb_segs as *const _ as usize },
+ 22usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(nb_segs)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).port as *const _ as usize },
+ 23usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(port)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).ol_flags as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(ol_flags)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).rx_descriptor_fields1 as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(rx_descriptor_fields1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).pkt_len as *const _ as usize },
+ 36usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(pkt_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).data_len as *const _ as usize },
+ 40usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(data_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).vlan_tci as *const _ as usize },
+ 42usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(vlan_tci)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).hash as *const _ as usize },
+ 44usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(hash)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).seqn as *const _ as usize },
+ 52usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(seqn)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).vlan_tci_outer as *const _ as usize },
+ 56usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(vlan_tci_outer)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).cacheline1 as *const _ as usize },
+ 64usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(cacheline1)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).pool as *const _ as usize },
+ 72usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(pool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).next as *const _ as usize },
+ 80usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(next)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).priv_size as *const _ as usize },
+ 96usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(priv_size)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const rte_mbuf)).timesync as *const _ as usize },
+ 98usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(rte_mbuf),
+ "::",
+ stringify!(timesync)
+ )
+ );
}
impl Default for rte_mbuf {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// < Pool from which mbuf was allocated.
#[repr(C)]
@@ -1094,5 +1365,7 @@ pub struct rte_mempool {
pub _address: u8,
}
impl Clone for rte_mempool {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/libclang-3.8/auto.rs b/tests/expectations/tests/libclang-3.8/auto.rs
index cf7320f5..6e2d9af3 100644
--- a/tests/expectations/tests/libclang-3.8/auto.rs
+++ b/tests/expectations/tests/libclang-3.8/auto.rs
@@ -11,17 +11,25 @@ pub struct Foo {
}
extern "C" {
#[link_name = "_ZN3Foo4kFooE"]
- pub static Foo_kFoo: bool;
+ pub static mut Foo_kFoo: bool;
}
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
diff --git a/tests/expectations/tests/libclang-3.8/call-conv-field.rs b/tests/expectations/tests/libclang-3.8/call-conv-field.rs
index 31fb309c..c5769c4c 100644
--- a/tests/expectations/tests/libclang-3.8/call-conv-field.rs
+++ b/tests/expectations/tests/libclang-3.8/call-conv-field.rs
@@ -7,34 +7,54 @@
#[repr(C)]
#[derive(Copy)]
pub struct JNINativeInterface_ {
- pub GetVersion: ::std::option::Option<unsafe extern "stdcall" fn(env:
- *mut ::std::os::raw::c_void)
- -> ::std::os::raw::c_int>,
+ pub GetVersion: ::std::option::Option<
+ unsafe extern "stdcall" fn(env: *mut ::std::os::raw::c_void)
+ -> ::std::os::raw::c_int,
+ >,
pub __hack: ::std::os::raw::c_ulonglong,
}
#[test]
fn bindgen_test_layout_JNINativeInterface_() {
- assert_eq!(::std::mem::size_of::<JNINativeInterface_>() , 16usize , concat
- ! ( "Size of: " , stringify ! ( JNINativeInterface_ ) ));
- assert_eq! (::std::mem::align_of::<JNINativeInterface_>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( JNINativeInterface_ ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const JNINativeInterface_ ) ) . GetVersion as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
- "::" , stringify ! ( GetVersion ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const JNINativeInterface_ ) ) . __hack as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
- "::" , stringify ! ( __hack ) ));
+ assert_eq!(
+ ::std::mem::size_of::<JNINativeInterface_>(),
+ 16usize,
+ concat!("Size of: ", stringify!(JNINativeInterface_))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<JNINativeInterface_>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(JNINativeInterface_))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const JNINativeInterface_)).GetVersion as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(JNINativeInterface_),
+ "::",
+ stringify!(GetVersion)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const JNINativeInterface_)).__hack as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(JNINativeInterface_),
+ "::",
+ stringify!(__hack)
+ )
+ );
}
impl Clone for JNINativeInterface_ {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for JNINativeInterface_ {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "C" {
#[link_name = "_bar@0"]
diff --git a/tests/expectations/tests/libclang-3.8/const_bool.rs b/tests/expectations/tests/libclang-3.8/const_bool.rs
index cc150436..ad6a60d8 100644
--- a/tests/expectations/tests/libclang-3.8/const_bool.rs
+++ b/tests/expectations/tests/libclang-3.8/const_bool.rs
@@ -6,7 +6,7 @@
extern "C" {
#[link_name = "_ZL1k"]
- pub static k: bool;
+ pub static mut k: bool;
}
#[repr(C)]
#[derive(Debug, Default, Copy)]
@@ -15,20 +15,28 @@ pub struct A {
}
extern "C" {
#[link_name = "_ZN1A1kE"]
- pub static A_k: bool;
+ pub static mut A_k: bool;
}
#[test]
fn bindgen_test_layout_A() {
- assert_eq!(::std::mem::size_of::<A>() , 1usize , concat ! (
- "Size of: " , stringify ! ( A ) ));
- assert_eq! (::std::mem::align_of::<A>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( A ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A>(),
+ 1usize,
+ concat!("Size of: ", stringify!(A))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(A))
+ );
}
impl Clone for A {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
pub type foo = bool;
extern "C" {
#[link_name = "_ZL2k2"]
- pub static k2: foo;
+ pub static mut k2: foo;
}
diff --git a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
index 9089b442..4f9e62da 100644
--- a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
+++ b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
@@ -13,23 +13,23 @@ pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
pub const k: EasyToOverflow = 2147483648;
extern "C" {
#[link_name = "k_expr"]
- pub static k_expr: EasyToOverflow;
+ pub static mut k_expr: EasyToOverflow;
}
extern "C" {
#[link_name = "BAZ"]
- pub static BAZ: ::std::os::raw::c_longlong;
+ pub static mut BAZ: ::std::os::raw::c_longlong;
}
extern "C" {
#[link_name = "fuzz"]
- pub static fuzz: f64;
+ pub static mut fuzz: f64;
}
extern "C" {
#[link_name = "BAZZ"]
- pub static BAZZ: ::std::os::raw::c_char;
+ pub static mut BAZZ: ::std::os::raw::c_char;
}
extern "C" {
#[link_name = "WAT"]
- pub static WAT: ::std::os::raw::c_char;
+ pub static mut WAT: ::std::os::raw::c_char;
}
extern "C" {
#[link_name = "bytestring"]
diff --git a/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs b/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs
index 376b43cb..0603873d 100644
--- a/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs
+++ b/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs
@@ -14,29 +14,26 @@ pub mod root {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for Rooted<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for Rooted<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation_1() {
- assert_eq!(::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
}
}
diff --git a/tests/expectations/tests/libclang-3.8/objc_template.rs b/tests/expectations/tests/libclang-3.8/objc_template.rs
index 16efa59e..c5d16ae1 100644
--- a/tests/expectations/tests/libclang-3.8/objc_template.rs
+++ b/tests/expectations/tests/libclang-3.8/objc_template.rs
@@ -2,17 +2,17 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub trait Foo {
- unsafe fn get(self)
- -> id;
+ unsafe fn get(self) -> id;
}
impl Foo for id {
- unsafe fn get(self) -> id { msg_send!(self , get) }
+ unsafe fn get(self) -> id {
+ msg_send!(self, get)
+ }
}
diff --git a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
index 159cad11..d867e73a 100644
--- a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
@@ -25,17 +25,25 @@ extern "C" {
}
#[test]
fn bindgen_test_layout_Usage() {
- assert_eq!(::std::mem::size_of::<Usage>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Usage ) ));
- assert_eq! (::std::mem::align_of::<Usage>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Usage ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Usage>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Usage))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Usage>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Usage))
+ );
}
extern "C" {
#[link_name = "_ZN5UsageC1Ev"]
pub fn Usage_Usage(this: *mut Usage);
}
impl Clone for Usage {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Usage {
#[inline]
diff --git a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
index 7728ddeb..590f491a 100644
--- a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
+++ b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
@@ -11,18 +11,31 @@ pub struct Rooted {
}
#[test]
fn bindgen_test_layout_Rooted() {
- assert_eq!(::std::mem::size_of::<Rooted>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Rooted ) ));
- assert_eq! (::std::mem::align_of::<Rooted>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Rooted ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Rooted ) ) . ptr as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Rooted ) , "::" ,
- stringify ! ( ptr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Rooted>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Rooted))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Rooted>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Rooted))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Rooted),
+ "::",
+ stringify!(ptr)
+ )
+ );
}
impl Clone for Rooted {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// <div rustbindgen replaces="MaybeWrapped"></div>
pub type MaybeWrapped<a> = a;
diff --git a/tests/expectations/tests/libclang-3.9/auto.rs b/tests/expectations/tests/libclang-3.9/auto.rs
index 70743067..4f5ee5b6 100644
--- a/tests/expectations/tests/libclang-3.9/auto.rs
+++ b/tests/expectations/tests/libclang-3.9/auto.rs
@@ -12,13 +12,21 @@ pub struct Foo {
pub const Foo_kFoo: bool = true;
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
diff --git a/tests/expectations/tests/libclang-3.9/call-conv-field.rs b/tests/expectations/tests/libclang-3.9/call-conv-field.rs
index 39943119..ea794b68 100644
--- a/tests/expectations/tests/libclang-3.9/call-conv-field.rs
+++ b/tests/expectations/tests/libclang-3.9/call-conv-field.rs
@@ -7,34 +7,54 @@
#[repr(C)]
#[derive(Copy)]
pub struct JNINativeInterface_ {
- pub GetVersion: ::std::option::Option<unsafe extern "stdcall" fn(env:
- *mut ::std::os::raw::c_void)
- -> ::std::os::raw::c_int>,
+ pub GetVersion: ::std::option::Option<
+ unsafe extern "stdcall" fn(env: *mut ::std::os::raw::c_void)
+ -> ::std::os::raw::c_int,
+ >,
pub __hack: ::std::os::raw::c_ulonglong,
}
#[test]
fn bindgen_test_layout_JNINativeInterface_() {
- assert_eq!(::std::mem::size_of::<JNINativeInterface_>() , 16usize , concat
- ! ( "Size of: " , stringify ! ( JNINativeInterface_ ) ));
- assert_eq! (::std::mem::align_of::<JNINativeInterface_>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( JNINativeInterface_ ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const JNINativeInterface_ ) ) . GetVersion as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
- "::" , stringify ! ( GetVersion ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const JNINativeInterface_ ) ) . __hack as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
- "::" , stringify ! ( __hack ) ));
+ assert_eq!(
+ ::std::mem::size_of::<JNINativeInterface_>(),
+ 16usize,
+ concat!("Size of: ", stringify!(JNINativeInterface_))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<JNINativeInterface_>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(JNINativeInterface_))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const JNINativeInterface_)).GetVersion as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(JNINativeInterface_),
+ "::",
+ stringify!(GetVersion)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const JNINativeInterface_)).__hack as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(JNINativeInterface_),
+ "::",
+ stringify!(__hack)
+ )
+ );
}
impl Clone for JNINativeInterface_ {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for JNINativeInterface_ {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "stdcall" {
#[link_name = "_bar@0"]
diff --git a/tests/expectations/tests/libclang-3.9/const_bool.rs b/tests/expectations/tests/libclang-3.9/const_bool.rs
index fd0273aa..7106e0ab 100644
--- a/tests/expectations/tests/libclang-3.9/const_bool.rs
+++ b/tests/expectations/tests/libclang-3.9/const_bool.rs
@@ -13,13 +13,21 @@ pub struct A {
pub const A_k: bool = false;
#[test]
fn bindgen_test_layout_A() {
- assert_eq!(::std::mem::size_of::<A>() , 1usize , concat ! (
- "Size of: " , stringify ! ( A ) ));
- assert_eq! (::std::mem::align_of::<A>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( A ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A>(),
+ 1usize,
+ concat!("Size of: ", stringify!(A))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(A))
+ );
}
impl Clone for A {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
pub type foo = bool;
pub const k2: foo = true;
diff --git a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs
index ffa3fff8..096bc182 100644
--- a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs
+++ b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs
@@ -8,7 +8,10 @@ pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum _bindgen_ty_1 { foo = 4, bar = 8, }
+pub enum _bindgen_ty_1 {
+ foo = 4,
+ bar = 8,
+}
pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
pub const k: EasyToOverflow = 2147483648;
pub const k_expr: EasyToOverflow = 0;
@@ -16,5 +19,5 @@ pub const BAZ: ::std::os::raw::c_longlong = 24;
pub const fuzz: f64 = 51.;
pub const BAZZ: ::std::os::raw::c_char = 53;
pub const WAT: ::std::os::raw::c_char = 0;
-pub const bytestring: &'static [u8; 4usize] = b"Foo\x00";
-pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0];
+pub const bytestring: &'static [u8; 4usize] = b"Foo\0";
+pub const NOT_UTF8: [u8; 5usize] = [240u8, 40u8, 140u8, 40u8, 0u8];
diff --git a/tests/expectations/tests/libclang-3.9/issue-769-bad-instantiation-test.rs b/tests/expectations/tests/libclang-3.9/issue-769-bad-instantiation-test.rs
index 376b43cb..0603873d 100644
--- a/tests/expectations/tests/libclang-3.9/issue-769-bad-instantiation-test.rs
+++ b/tests/expectations/tests/libclang-3.9/issue-769-bad-instantiation-test.rs
@@ -14,29 +14,26 @@ pub mod root {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for Rooted<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for Rooted<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation_1() {
- assert_eq!(::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
}
}
diff --git a/tests/expectations/tests/libclang-3.9/objc_template.rs b/tests/expectations/tests/libclang-3.9/objc_template.rs
index 16efa59e..c5d16ae1 100644
--- a/tests/expectations/tests/libclang-3.9/objc_template.rs
+++ b/tests/expectations/tests/libclang-3.9/objc_template.rs
@@ -2,17 +2,17 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub trait Foo {
- unsafe fn get(self)
- -> id;
+ unsafe fn get(self) -> id;
}
impl Foo for id {
- unsafe fn get(self) -> id { msg_send!(self , get) }
+ unsafe fn get(self) -> id {
+ msg_send!(self, get)
+ }
}
diff --git a/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
index 4f6794e9..84319c75 100644
--- a/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
@@ -25,11 +25,19 @@ extern "C" {
}
#[test]
fn bindgen_test_layout_Usage() {
- assert_eq!(::std::mem::size_of::<Usage>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Usage ) ));
- assert_eq! (::std::mem::align_of::<Usage>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Usage ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Usage>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Usage))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Usage>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Usage))
+ );
}
impl Clone for Usage {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs
index 7728ddeb..590f491a 100644
--- a/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs
+++ b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs
@@ -11,18 +11,31 @@ pub struct Rooted {
}
#[test]
fn bindgen_test_layout_Rooted() {
- assert_eq!(::std::mem::size_of::<Rooted>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Rooted ) ));
- assert_eq! (::std::mem::align_of::<Rooted>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Rooted ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Rooted ) ) . ptr as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Rooted ) , "::" ,
- stringify ! ( ptr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Rooted>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Rooted))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Rooted>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Rooted))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Rooted),
+ "::",
+ stringify!(ptr)
+ )
+ );
}
impl Clone for Rooted {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// <div rustbindgen replaces="MaybeWrapped"></div>
pub type MaybeWrapped<a> = a;
diff --git a/tests/expectations/tests/libclang-4/constant-evaluate.rs b/tests/expectations/tests/libclang-4/constant-evaluate.rs
index ffa3fff8..096bc182 100644
--- a/tests/expectations/tests/libclang-4/constant-evaluate.rs
+++ b/tests/expectations/tests/libclang-4/constant-evaluate.rs
@@ -8,7 +8,10 @@ pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum _bindgen_ty_1 { foo = 4, bar = 8, }
+pub enum _bindgen_ty_1 {
+ foo = 4,
+ bar = 8,
+}
pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
pub const k: EasyToOverflow = 2147483648;
pub const k_expr: EasyToOverflow = 0;
@@ -16,5 +19,5 @@ pub const BAZ: ::std::os::raw::c_longlong = 24;
pub const fuzz: f64 = 51.;
pub const BAZZ: ::std::os::raw::c_char = 53;
pub const WAT: ::std::os::raw::c_char = 0;
-pub const bytestring: &'static [u8; 4usize] = b"Foo\x00";
-pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0];
+pub const bytestring: &'static [u8; 4usize] = b"Foo\0";
+pub const NOT_UTF8: [u8; 5usize] = [240u8, 40u8, 140u8, 40u8, 0u8];
diff --git a/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs b/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs
index 392f7a0a..86fad78d 100644
--- a/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs
+++ b/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs
@@ -14,30 +14,27 @@ pub mod root {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for Rooted<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for Rooted<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub type AutoValueVector_Alias = ::std::os::raw::c_int;
#[test]
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_Rooted_open0_AutoValueVector_Alias_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<root::Rooted<root::AutoValueVector_Alias>>()
- , 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::Rooted<root::AutoValueVector_Alias> ) ));
- assert_eq!(::std::mem::align_of::<root::Rooted<root::AutoValueVector_Alias>>()
- , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::Rooted<root::AutoValueVector_Alias> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < root :: Rooted < root :: AutoValueVector_Alias > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( root :: Rooted < root :: AutoValueVector_Alias > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < root :: AutoValueVector_Alias > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < root :: AutoValueVector_Alias > ) ) );
}
}
diff --git a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs
index 66331e28..b8d4fbec 100644
--- a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs
+++ b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs
@@ -11,32 +11,48 @@ pub struct Rooted {
}
#[test]
fn bindgen_test_layout_Rooted() {
- assert_eq!(::std::mem::size_of::<Rooted>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Rooted ) ));
- assert_eq! (::std::mem::align_of::<Rooted>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Rooted ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Rooted ) ) . ptr as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Rooted ) , "::" ,
- stringify ! ( ptr ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Rooted>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Rooted))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Rooted>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Rooted))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Rooted)).ptr as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Rooted),
+ "::",
+ stringify!(ptr)
+ )
+ );
}
impl Clone for Rooted {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for Rooted {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// <div rustbindgen replaces="MaybeWrapped"></div>
pub type MaybeWrapped<a> = a;
#[test]
fn __bindgen_test_layout_MaybeWrapped_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<MaybeWrapped<::std::os::raw::c_int>>() ,
- 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- MaybeWrapped<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<MaybeWrapped<::std::os::raw::c_int>>() ,
- 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- MaybeWrapped<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<MaybeWrapped<::std::os::raw::c_int>>(),
+ 4usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( MaybeWrapped < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < MaybeWrapped < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( MaybeWrapped < :: std :: os :: raw :: c_int > ) ) );
}
diff --git a/tests/expectations/tests/macro_const.rs b/tests/expectations/tests/macro_const.rs
index b7b7cc2c..382af9a5 100644
--- a/tests/expectations/tests/macro_const.rs
+++ b/tests/expectations/tests/macro_const.rs
@@ -4,9 +4,9 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-pub const foo: &'static [u8; 4usize] = b"bar\x00";
-pub const CHAR: u8 = b'b';
-pub const CHARR: u8 = b'\x00';
+pub const foo: &'static [u8; 4usize] = b"bar\0";
+pub const CHAR: u8 = 98u8;
+pub const CHARR: u8 = 0u8;
pub const FLOAT: f64 = 5.09;
pub const FLOAT_EXPR: f64 = 0.005;
-pub const INVALID_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0];
+pub const INVALID_UTF8: [u8; 5usize] = [240u8, 40u8, 140u8, 40u8, 0u8];
diff --git a/tests/expectations/tests/mangling-win32.rs b/tests/expectations/tests/mangling-win32.rs
index ffaf52cf..747ccbf5 100644
--- a/tests/expectations/tests/mangling-win32.rs
+++ b/tests/expectations/tests/mangling-win32.rs
@@ -18,11 +18,19 @@ extern "C" {
}
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs
index 1e954298..dec8fabb 100644
--- a/tests/expectations/tests/namespace.rs
+++ b/tests/expectations/tests/namespace.rs
@@ -9,7 +9,7 @@ pub mod root {
#[allow(unused_imports)]
use self::super::root;
extern "C" {
- #[link_name = "_Z9top_levelv"]
+ #[link_name = "_Z9top_levelv"]
pub fn top_level();
}
pub mod whatever {
@@ -17,7 +17,7 @@ pub mod root {
use self::super::super::root;
pub type whatever_int_t = ::std::os::raw::c_int;
extern "C" {
- #[link_name = "_ZN8whatever11in_whateverEv"]
+ #[link_name = "_ZN8whatever11in_whateverEv"]
pub fn in_whatever();
}
}
@@ -25,7 +25,7 @@ pub mod root {
#[allow(unused_imports)]
use self::super::super::root;
extern "C" {
- #[link_name = "_ZN12_GLOBAL__N_13fooEv"]
+ #[link_name = "_ZN12_GLOBAL__N_13fooEv"]
pub fn foo();
}
#[repr(C)]
@@ -35,29 +35,36 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_A() {
- assert_eq!(::std::mem::size_of::<A>() , 4usize , concat ! (
- "Size of: " , stringify ! ( A ) ));
- assert_eq! (::std::mem::align_of::<A>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( A ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const A ) ) . b as * const _ as usize }
- , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( A ) , "::" ,
- stringify ! ( b ) ));
+ assert_eq!(
+ ::std::mem::size_of::<A>(),
+ 4usize,
+ concat!("Size of: ", stringify!(A))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<A>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(A))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const A)).b as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(A), "::", stringify!(b))
+ );
}
extern "C" {
- #[link_name = "_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"]
- pub fn A_lets_hope_this_works(this:
- *mut root::_bindgen_mod_id_13::A)
- -> ::std::os::raw::c_int;
+ #[link_name = "_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"]
+ pub fn A_lets_hope_this_works(
+ this: *mut root::_bindgen_mod_id_13::A,
+ ) -> ::std::os::raw::c_int;
}
impl Clone for A {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl A {
#[inline]
- pub unsafe fn lets_hope_this_works(&mut self)
- -> ::std::os::raw::c_int {
+ pub unsafe fn lets_hope_this_works(&mut self) -> ::std::os::raw::c_int {
A_lets_hope_this_works(self)
}
}
@@ -71,8 +78,10 @@ pub mod root {
pub m_c_arr: [T; 10usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for C<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for C<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub mod w {
#[allow(unused_imports)]
@@ -84,19 +93,21 @@ pub mod root {
pub m_c: root::C<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for D<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for D<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "C" {
- #[link_name = "_ZN1w3hehEv"]
+ #[link_name = "_ZN1w3hehEv"]
pub fn heh() -> root::w::whatever_int_t;
}
extern "C" {
- #[link_name = "_ZN1w3fooEv"]
+ #[link_name = "_ZN1w3fooEv"]
pub fn foo() -> root::C<::std::os::raw::c_int>;
}
extern "C" {
- #[link_name = "_ZN1w4barrEv"]
+ #[link_name = "_ZN1w4barrEv"]
pub fn barr() -> root::C<f32>;
}
}
diff --git a/tests/expectations/tests/no-derive-debug.rs b/tests/expectations/tests/no-derive-debug.rs
index f1616e64..a36b6247 100644
--- a/tests/expectations/tests/no-derive-debug.rs
+++ b/tests/expectations/tests/no-derive-debug.rs
@@ -3,7 +3,12 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }
+#[repr(C)]
+#[derive(Copy, Clone, Default)]
+pub struct foo {
+ bar: ::std::os::raw::c_int,
+}
+
/// bar should compile. It will normally derive debug, but our blacklist of foo
/// and replacement for another type that doesn't implement it would prevent it
@@ -15,21 +20,39 @@ pub struct bar {
}
#[test]
fn bindgen_test_layout_bar() {
- assert_eq!(::std::mem::size_of::<bar>() , 8usize , concat ! (
- "Size of: " , stringify ! ( bar ) ));
- assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . foo as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( baz ) ));
+ assert_eq!(
+ ::std::mem::size_of::<bar>(),
+ 8usize,
+ concat!("Size of: ", stringify!(bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<bar>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).foo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(foo)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).baz as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(baz)
+ )
+ );
}
impl Default for bar {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/no-derive-default.rs b/tests/expectations/tests/no-derive-default.rs
index cdb89eb1..8c290e38 100644
--- a/tests/expectations/tests/no-derive-default.rs
+++ b/tests/expectations/tests/no-derive-default.rs
@@ -3,7 +3,12 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct foo { bar: ::std::os::raw::c_int, }
+#[repr(C)]
+#[derive(Copy, Clone, Debug)]
+pub struct foo {
+ bar: ::std::os::raw::c_int,
+}
+
/// bar should compile. It will normally derive default, but our blacklist of foo
/// and replacement for another type that doesn't implement it would prevent it
@@ -15,18 +20,34 @@ pub struct bar {
}
#[test]
fn bindgen_test_layout_bar() {
- assert_eq!(::std::mem::size_of::<bar>() , 8usize , concat ! (
- "Size of: " , stringify ! ( bar ) ));
- assert_eq! (::std::mem::align_of::<bar>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . foo as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bar ) ) . baz as * const _ as usize } ,
- 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bar ) , "::" ,
- stringify ! ( baz ) ));
+ assert_eq!(
+ ::std::mem::size_of::<bar>(),
+ 8usize,
+ concat!("Size of: ", stringify!(bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<bar>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).foo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(foo)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bar)).baz as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bar),
+ "::",
+ stringify!(baz)
+ )
+ );
}
diff --git a/tests/expectations/tests/no_copy.rs b/tests/expectations/tests/no_copy.rs
index ca28bdeb..45249668 100644
--- a/tests/expectations/tests/no_copy.rs
+++ b/tests/expectations/tests/no_copy.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen nocopy></div>
#[repr(C)]
#[derive(Debug, Default)]
diff --git a/tests/expectations/tests/nsBaseHashtable.rs b/tests/expectations/tests/nsBaseHashtable.rs
new file mode 100644
index 00000000..338978e1
--- /dev/null
+++ b/tests/expectations/tests/nsBaseHashtable.rs
@@ -0,0 +1,50 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct nsBaseHashtableET {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct nsTHashtable {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct nsBaseHashtable {
+ pub _address: u8,
+}
+pub type nsBaseHashtable_KeyType = [u8; 0usize];
+pub type nsBaseHashtable_EntryType = nsBaseHashtableET;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct nsBaseHashtable_LookupResult {
+ pub mEntry: *mut nsBaseHashtable_EntryType,
+ pub mTable: *mut nsBaseHashtable,
+}
+impl Default for nsBaseHashtable_LookupResult {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
+}
+#[repr(C)]
+#[derive(Debug)]
+pub struct nsBaseHashtable_EntryPtr {
+ pub mEntry: *mut nsBaseHashtable_EntryType,
+ pub mExistingEntry: bool,
+}
+impl Default for nsBaseHashtable_EntryPtr {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
+}
+impl Default for nsBaseHashtable {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
+}
diff --git a/tests/expectations/tests/objc_class_method.rs b/tests/expectations/tests/objc_class_method.rs
index 640ae07f..3803f1f8 100644
--- a/tests/expectations/tests/objc_class_method.rs
+++ b/tests/expectations/tests/objc_class_method.rs
@@ -2,8 +2,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
@@ -13,42 +12,55 @@ pub trait Foo {
unsafe fn method();
unsafe fn methodWithInt_(foo: ::std::os::raw::c_int);
unsafe fn methodWithFoo_(foo: id);
- unsafe fn methodReturningInt()
- -> ::std::os::raw::c_int;
- unsafe fn methodReturningFoo()
- -> *mut id;
- unsafe fn methodWithArg1_andArg2_andArg3_(intvalue: ::std::os::raw::c_int,
- ptr:
- *mut ::std::os::raw::c_char,
- floatvalue: f32);
+ unsafe fn methodReturningInt() -> ::std::os::raw::c_int;
+ unsafe fn methodReturningFoo() -> *mut id;
+ unsafe fn methodWithArg1_andArg2_andArg3_(
+ intvalue: ::std::os::raw::c_int,
+ ptr: *mut ::std::os::raw::c_char,
+ floatvalue: f32,
+ );
}
impl Foo for id {
unsafe fn method() {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , method)
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ method
+ )
}
unsafe fn methodWithInt_(foo: ::std::os::raw::c_int) {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , methodWithInt:foo )
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ methodWithInt: foo: ::std::os::raw::c_int
+ )
}
unsafe fn methodWithFoo_(foo: id) {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , methodWithFoo:foo )
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ methodWithFoo: foo: id
+ )
}
unsafe fn methodReturningInt() -> ::std::os::raw::c_int {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , methodReturningInt)
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ methodReturningInt
+ )
}
unsafe fn methodReturningFoo() -> *mut id {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , methodReturningFoo)
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ methodReturningFoo
+ )
}
- unsafe fn methodWithArg1_andArg2_andArg3_(intvalue: ::std::os::raw::c_int,
- ptr:
- *mut ::std::os::raw::c_char,
- floatvalue: f32) {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) ,
- methodWithArg1:intvalue andArg2:ptr andArg3:floatvalue )
+ unsafe fn methodWithArg1_andArg2_andArg3_(
+ intvalue: ::std::os::raw::c_int,
+ ptr: *mut ::std::os::raw::c_char,
+ floatvalue: f32,
+ ) {
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ methodWithArg1: intvalue: ::std::os::raw::c_int,
+ andArg2: ptr: *mut ::std::os::raw::c_char,
+ andArg3: floatvalue: f32
+ )
}
}
diff --git a/tests/expectations/tests/objc_method.rs b/tests/expectations/tests/objc_method.rs
index 2b57a938..abf55849 100644
--- a/tests/expectations/tests/objc_method.rs
+++ b/tests/expectations/tests/objc_method.rs
@@ -2,8 +2,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
@@ -13,36 +12,42 @@ pub trait Foo {
unsafe fn method(self);
unsafe fn methodWithInt_(self, foo: ::std::os::raw::c_int);
unsafe fn methodWithFoo_(self, foo: id);
- unsafe fn methodReturningInt(self)
- -> ::std::os::raw::c_int;
- unsafe fn methodReturningFoo(self)
- -> *mut id;
- unsafe fn methodWithArg1_andArg2_andArg3_(self,
- intvalue: ::std::os::raw::c_int,
- ptr:
- *mut ::std::os::raw::c_char,
- floatvalue: f32);
+ unsafe fn methodReturningInt(self) -> ::std::os::raw::c_int;
+ unsafe fn methodReturningFoo(self) -> *mut id;
+ unsafe fn methodWithArg1_andArg2_andArg3_(
+ self,
+ intvalue: ::std::os::raw::c_int,
+ ptr: *mut ::std::os::raw::c_char,
+ floatvalue: f32,
+ );
}
impl Foo for id {
- unsafe fn method(self) { msg_send!(self , method) }
+ unsafe fn method(self) {
+ msg_send!(self, method)
+ }
unsafe fn methodWithInt_(self, foo: ::std::os::raw::c_int) {
- msg_send!(self , methodWithInt:foo )
+ msg_send!(self, methodWithInt: foo: ::std::os::raw::c_int)
}
unsafe fn methodWithFoo_(self, foo: id) {
- msg_send!(self , methodWithFoo:foo )
+ msg_send!(self, methodWithFoo: foo: id)
}
unsafe fn methodReturningInt(self) -> ::std::os::raw::c_int {
- msg_send!(self , methodReturningInt)
+ msg_send!(self, methodReturningInt)
}
unsafe fn methodReturningFoo(self) -> *mut id {
- msg_send!(self , methodReturningFoo)
+ msg_send!(self, methodReturningFoo)
}
- unsafe fn methodWithArg1_andArg2_andArg3_(self,
- intvalue: ::std::os::raw::c_int,
- ptr:
- *mut ::std::os::raw::c_char,
- floatvalue: f32) {
- msg_send!(self ,
- methodWithArg1:intvalue andArg2:ptr andArg3:floatvalue )
+ unsafe fn methodWithArg1_andArg2_andArg3_(
+ self,
+ intvalue: ::std::os::raw::c_int,
+ ptr: *mut ::std::os::raw::c_char,
+ floatvalue: f32,
+ ) {
+ msg_send!(
+ self,
+ methodWithArg1: intvalue: ::std::os::raw::c_int,
+ andArg2: ptr: *mut ::std::os::raw::c_char,
+ andArg3: floatvalue: f32
+ )
}
}
diff --git a/tests/expectations/tests/objc_method_clash.rs b/tests/expectations/tests/objc_method_clash.rs
index 88c2bd28..f57951b4 100644
--- a/tests/expectations/tests/objc_method_clash.rs
+++ b/tests/expectations/tests/objc_method_clash.rs
@@ -2,8 +2,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
@@ -14,9 +13,13 @@ pub trait Foo {
unsafe fn class_foo();
}
impl Foo for id {
- unsafe fn foo(self) { msg_send!(self , foo) }
+ unsafe fn foo(self) {
+ msg_send!(self, foo)
+ }
unsafe fn class_foo() {
- msg_send!(objc :: runtime :: Class :: get ( "Foo" ) . expect (
- "Couldn\'t find Foo" ) , foo)
+ msg_send!(
+ objc::runtime::Class::get("Foo").expect("Couldn't find Foo"),
+ foo
+ )
}
}
diff --git a/tests/expectations/tests/objc_property_fnptr.rs b/tests/expectations/tests/objc_property_fnptr.rs
index 2d7e08ed..16e0b4ba 100644
--- a/tests/expectations/tests/objc_property_fnptr.rs
+++ b/tests/expectations/tests/objc_property_fnptr.rs
@@ -2,34 +2,30 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub trait Foo {
- unsafe fn func(self)
- -> ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>;
- unsafe fn setFunc_(self,
- func:
- ::std::option::Option<unsafe extern "C" fn()
- ->
- ::std::os::raw::c_int>);
+ unsafe fn func(self) -> ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>;
+ unsafe fn setFunc_(
+ self,
+ func: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>,
+ );
}
impl Foo for id {
- unsafe fn func(self)
- ->
- ::std::option::Option<unsafe extern "C" fn()
- -> ::std::os::raw::c_int> {
- msg_send!(self , func)
+ unsafe fn func(self) -> ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int> {
+ msg_send!(self, func)
}
- unsafe fn setFunc_(self,
- func:
- ::std::option::Option<unsafe extern "C" fn()
- ->
- ::std::os::raw::c_int>) {
- msg_send!(self , setFunc:func )
+ unsafe fn setFunc_(
+ self,
+ func: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>,
+ ) {
+ msg_send!(
+ self,
+ setFunc: func: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>
+ )
}
}
diff --git a/tests/expectations/tests/objc_whitelist.rs b/tests/expectations/tests/objc_whitelist.rs
index 1f722b70..4eba7c7f 100644
--- a/tests/expectations/tests/objc_whitelist.rs
+++ b/tests/expectations/tests/objc_whitelist.rs
@@ -1,9 +1,9 @@
/* automatically generated by rust-bindgen */
-#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-
-#![cfg(target_os="macos")]
+#![allow(dead_code, non_snake_case, non_camel_case_types,
+ non_upper_case_globals)]
+#![cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
@@ -14,10 +14,15 @@ pub trait protocol_SomeProtocol {
unsafe fn protocolClassMethod();
}
impl protocol_SomeProtocol for id {
- unsafe fn protocolMethod(self) { msg_send!(self , protocolMethod) }
+ unsafe fn protocolMethod(self) {
+ msg_send!(self, protocolMethod)
+ }
unsafe fn protocolClassMethod() {
- msg_send!(objc :: runtime :: Class :: get ( "SomeProtocol" ) . expect
- ( "Couldn\'t find SomeProtocol" ) , protocolClassMethod)
+ msg_send!(
+ objc::runtime::Class::get("SomeProtocol")
+ .expect("Couldn't find SomeProtocol"),
+ protocolClassMethod
+ )
}
}
pub trait WhitelistMe {
@@ -25,11 +30,16 @@ pub trait WhitelistMe {
unsafe fn classMethod();
}
impl WhitelistMe for id {
- unsafe fn method(self) { msg_send!(self , method) }
+ unsafe fn method(self) {
+ msg_send!(self, method)
+ }
unsafe fn classMethod() {
- msg_send!(objc :: runtime :: Class :: get ( "WhitelistMe" ) . expect (
- "Couldn\'t find WhitelistMe" ) , classMethod)
+ msg_send!(
+ objc::runtime::Class::get("WhitelistMe")
+ .expect("Couldn't find WhitelistMe"),
+ classMethod
+ )
}
}
-pub trait WhitelistMe_InterestingCategory { }
-impl WhitelistMe_InterestingCategory for id { }
+pub trait WhitelistMe_InterestingCategory {}
+impl WhitelistMe_InterestingCategory for id {}
diff --git a/tests/expectations/tests/only_bitfields.rs b/tests/expectations/tests/only_bitfields.rs
index 64a1fd79..13fb00ba 100644
--- a/tests/expectations/tests/only_bitfields.rs
+++ b/tests/expectations/tests/only_bitfields.rs
@@ -12,24 +12,32 @@ pub struct C {
}
#[test]
fn bindgen_test_layout_C() {
- assert_eq!(::std::mem::size_of::<C>() , 1usize , concat ! (
- "Size of: " , stringify ! ( C ) ));
- assert_eq! (::std::mem::align_of::<C>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( C ) ));
+ assert_eq!(
+ ::std::mem::size_of::<C>(),
+ 1usize,
+ concat!("Size of: ", stringify!(C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<C>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(C))
+ );
}
impl Clone for C {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl C {
#[inline]
pub fn a(&self) -> bool {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -41,31 +49,31 @@ impl C {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn b(&self) -> bool {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 254u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -77,25 +85,25 @@ impl C {
let val = val as u8 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn new_bitfield_1(a: bool, b: bool) -> u8 {
- ({ ({ 0 } | ((a as u8 as u8) << 0usize) & (1u64 as u8)) } |
- ((b as u8 as u8) << 1usize) & (254u64 as u8))
+ ((0 | ((a as u8 as u8) << 0usize) & (1u64 as u8)) |
+ ((b as u8 as u8) << 1usize) & (254u64 as u8))
}
}
diff --git a/tests/expectations/tests/opaque-template-inst-member-2.rs b/tests/expectations/tests/opaque-template-inst-member-2.rs
index 53122ba6..20b44d7e 100644
--- a/tests/expectations/tests/opaque-template-inst-member-2.rs
+++ b/tests/expectations/tests/opaque-template-inst-member-2.rs
@@ -4,12 +4,12 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// This is like `opaque-template-inst-member.hpp` except exercising the cases
/// where we are OK to derive Debug/Hash/PartialEq.
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
-pub struct OpaqueTemplate {
-}
+pub struct OpaqueTemplate {}
/// Should derive Debug/Hash/PartialEq.
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -19,25 +19,41 @@ pub struct ContainsOpaqueTemplate {
}
#[test]
fn bindgen_test_layout_ContainsOpaqueTemplate() {
- assert_eq!(::std::mem::size_of::<ContainsOpaqueTemplate>() , 8usize ,
- concat ! ( "Size of: " , stringify ! ( ContainsOpaqueTemplate )
- ));
- assert_eq! (::std::mem::align_of::<ContainsOpaqueTemplate>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( ContainsOpaqueTemplate ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsOpaqueTemplate ) ) . mBlah as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ContainsOpaqueTemplate
- ) , "::" , stringify ! ( mBlah ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsOpaqueTemplate ) ) . mBaz as *
- const _ as usize } , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( ContainsOpaqueTemplate
- ) , "::" , stringify ! ( mBaz ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ContainsOpaqueTemplate>(),
+ 8usize,
+ concat!("Size of: ", stringify!(ContainsOpaqueTemplate))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ContainsOpaqueTemplate>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(ContainsOpaqueTemplate))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBlah as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsOpaqueTemplate),
+ "::",
+ stringify!(mBlah)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ContainsOpaqueTemplate)).mBaz as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsOpaqueTemplate),
+ "::",
+ stringify!(mBaz)
+ )
+ );
}
impl Clone for ContainsOpaqueTemplate {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// Should also derive Debug/Hash/PartialEq.
#[repr(C)]
@@ -48,21 +64,34 @@ pub struct InheritsOpaqueTemplate {
}
#[test]
fn bindgen_test_layout_InheritsOpaqueTemplate() {
- assert_eq!(::std::mem::size_of::<InheritsOpaqueTemplate>() , 16usize ,
- concat ! ( "Size of: " , stringify ! ( InheritsOpaqueTemplate )
- ));
- assert_eq! (::std::mem::align_of::<InheritsOpaqueTemplate>() , 8usize ,
- concat ! (
- "Alignment of " , stringify ! ( InheritsOpaqueTemplate ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const InheritsOpaqueTemplate ) ) . wow as *
- const _ as usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( InheritsOpaqueTemplate
- ) , "::" , stringify ! ( wow ) ));
+ assert_eq!(
+ ::std::mem::size_of::<InheritsOpaqueTemplate>(),
+ 16usize,
+ concat!("Size of: ", stringify!(InheritsOpaqueTemplate))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<InheritsOpaqueTemplate>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(InheritsOpaqueTemplate))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const InheritsOpaqueTemplate)).wow as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(InheritsOpaqueTemplate),
+ "::",
+ stringify!(wow)
+ )
+ );
}
impl Clone for InheritsOpaqueTemplate {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for InheritsOpaqueTemplate {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs
index 7bf657ed..09818446 100644
--- a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs
+++ b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs
@@ -17,8 +17,10 @@ pub mod root {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
- impl <T> Default for Template<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ impl<T> Default for Template<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -27,18 +29,26 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_Foo() {
- assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Foo ) ));
- assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Foo ) ) . c as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Foo ) , "::" ,
- stringify ! ( c ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Foo>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Foo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Foo)).c as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(Foo), "::", stringify!(c))
+ );
}
impl Clone for Foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -47,18 +57,26 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_Bar() {
- assert_eq!(::std::mem::size_of::<Bar>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Bar ) ));
- assert_eq! (::std::mem::align_of::<Bar>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Bar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Bar ) ) . i as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Bar ) , "::" ,
- stringify ! ( i ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Bar>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Bar))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Bar>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Bar))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Bar)).i as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(Bar), "::", stringify!(i))
+ );
}
impl Clone for Bar {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -67,26 +85,36 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_ContainsInstantiation() {
- assert_eq!(::std::mem::size_of::<ContainsInstantiation>() , 1usize
- , concat ! (
- "Size of: " , stringify ! ( ContainsInstantiation ) ));
- assert_eq! (::std::mem::align_of::<ContainsInstantiation>() ,
- 1usize , concat ! (
- "Alignment of " , stringify ! ( ContainsInstantiation
- ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsInstantiation ) ) .
- not_opaque as * const _ as usize } , 0usize , concat !
- (
- "Alignment of field: " , stringify ! (
- ContainsInstantiation ) , "::" , stringify ! (
- not_opaque ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ContainsInstantiation>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ContainsInstantiation))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ContainsInstantiation>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ContainsInstantiation))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ContainsInstantiation)).not_opaque as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsInstantiation),
+ "::",
+ stringify!(not_opaque)
+ )
+ );
}
impl Clone for ContainsInstantiation {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for ContainsInstantiation {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -95,34 +123,45 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_ContainsOpaqueInstantiation() {
- assert_eq!(::std::mem::size_of::<ContainsOpaqueInstantiation>() ,
- 4usize , concat ! (
- "Size of: " , stringify ! ( ContainsOpaqueInstantiation
- ) ));
- assert_eq! (::std::mem::align_of::<ContainsOpaqueInstantiation>()
- , 4usize , concat ! (
- "Alignment of " , stringify ! (
- ContainsOpaqueInstantiation ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsOpaqueInstantiation ) ) .
- opaque as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- ContainsOpaqueInstantiation ) , "::" , stringify ! (
- opaque ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ContainsOpaqueInstantiation>(),
+ 4usize,
+ concat!("Size of: ", stringify!(ContainsOpaqueInstantiation))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ContainsOpaqueInstantiation>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(ContainsOpaqueInstantiation))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(0 as *const ContainsOpaqueInstantiation)).opaque as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsOpaqueInstantiation),
+ "::",
+ stringify!(opaque)
+ )
+ );
}
impl Clone for ContainsOpaqueInstantiation {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
}
#[test]
fn __bindgen_test_layout_Template_open0_Foo_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<root::zoidberg::Template<root::zoidberg::Foo>>()
- , 1usize , concat ! (
- "Size of template specialization: " , stringify ! (
- root::zoidberg::Template<root::zoidberg::Foo> ) ));
- assert_eq!(::std::mem::align_of::<root::zoidberg::Template<root::zoidberg::Foo>>()
- , 1usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- root::zoidberg::Template<root::zoidberg::Foo> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<root::zoidberg::Template<root::zoidberg::Foo>>(),
+ 1usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( root :: zoidberg :: Template < root :: zoidberg :: Foo > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < root :: zoidberg :: Template < root :: zoidberg :: Foo > > ( ) , 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: zoidberg :: Template < root :: zoidberg :: Foo > ) ) );
}
}
diff --git a/tests/expectations/tests/opaque-template-instantiation.rs b/tests/expectations/tests/opaque-template-instantiation.rs
index 010186a5..480dba48 100644
--- a/tests/expectations/tests/opaque-template-instantiation.rs
+++ b/tests/expectations/tests/opaque-template-instantiation.rs
@@ -10,8 +10,10 @@ pub struct Template<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for Template<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Template<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -20,23 +22,36 @@ pub struct ContainsInstantiation {
}
#[test]
fn bindgen_test_layout_ContainsInstantiation() {
- assert_eq!(::std::mem::size_of::<ContainsInstantiation>() , 1usize ,
- concat ! ( "Size of: " , stringify ! ( ContainsInstantiation )
- ));
- assert_eq! (::std::mem::align_of::<ContainsInstantiation>() , 1usize ,
- concat ! (
- "Alignment of " , stringify ! ( ContainsInstantiation ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsInstantiation ) ) . not_opaque as
- * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( ContainsInstantiation )
- , "::" , stringify ! ( not_opaque ) ));
+ assert_eq!(
+ ::std::mem::size_of::<ContainsInstantiation>(),
+ 1usize,
+ concat!("Size of: ", stringify!(ContainsInstantiation))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ContainsInstantiation>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(ContainsInstantiation))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ContainsInstantiation)).not_opaque as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsInstantiation),
+ "::",
+ stringify!(not_opaque)
+ )
+ );
}
impl Clone for ContainsInstantiation {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for ContainsInstantiation {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -45,31 +60,41 @@ pub struct ContainsOpaqueInstantiation {
}
#[test]
fn bindgen_test_layout_ContainsOpaqueInstantiation() {
- assert_eq!(::std::mem::size_of::<ContainsOpaqueInstantiation>() , 4usize ,
- concat ! (
- "Size of: " , stringify ! ( ContainsOpaqueInstantiation ) ));
- assert_eq! (::std::mem::align_of::<ContainsOpaqueInstantiation>() , 4usize
- , concat ! (
- "Alignment of " , stringify ! ( ContainsOpaqueInstantiation )
- ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const ContainsOpaqueInstantiation ) ) . opaque
- as * const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! (
- ContainsOpaqueInstantiation ) , "::" , stringify ! ( opaque )
- ));
+ assert_eq!(
+ ::std::mem::size_of::<ContainsOpaqueInstantiation>(),
+ 4usize,
+ concat!("Size of: ", stringify!(ContainsOpaqueInstantiation))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<ContainsOpaqueInstantiation>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(ContainsOpaqueInstantiation))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const ContainsOpaqueInstantiation)).opaque as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(ContainsOpaqueInstantiation),
+ "::",
+ stringify!(opaque)
+ )
+ );
}
impl Clone for ContainsOpaqueInstantiation {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn __bindgen_test_layout_Template_open0_char_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<Template<::std::os::raw::c_char>>() ,
- 1usize , concat ! (
- "Size of template specialization: " , stringify ! (
- Template<::std::os::raw::c_char> ) ));
- assert_eq!(::std::mem::align_of::<Template<::std::os::raw::c_char>>() ,
- 1usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- Template<::std::os::raw::c_char> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Template<::std::os::raw::c_char>>(),
+ 1usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( Template < :: std :: os :: raw :: c_char > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < Template < :: std :: os :: raw :: c_char > > ( ) , 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( Template < :: std :: os :: raw :: c_char > ) ) );
}
diff --git a/tests/expectations/tests/opaque_in_struct.rs b/tests/expectations/tests/opaque_in_struct.rs
index a4ba4649..49cfc5fc 100644
--- a/tests/expectations/tests/opaque_in_struct.rs
+++ b/tests/expectations/tests/opaque_in_struct.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen opaque>
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -12,13 +13,21 @@ pub struct opaque {
}
#[test]
fn bindgen_test_layout_opaque() {
- assert_eq!(::std::mem::size_of::<opaque>() , 4usize , concat ! (
- "Size of: " , stringify ! ( opaque ) ));
- assert_eq! (::std::mem::align_of::<opaque>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( opaque ) ));
+ assert_eq!(
+ ::std::mem::size_of::<opaque>(),
+ 4usize,
+ concat!("Size of: ", stringify!(opaque))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<opaque>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(opaque))
+ );
}
impl Clone for opaque {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -27,16 +36,29 @@ pub struct container {
}
#[test]
fn bindgen_test_layout_container() {
- assert_eq!(::std::mem::size_of::<container>() , 4usize , concat ! (
- "Size of: " , stringify ! ( container ) ));
- assert_eq! (::std::mem::align_of::<container>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( container ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const container ) ) . contained as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( container ) , "::" ,
- stringify ! ( contained ) ));
+ assert_eq!(
+ ::std::mem::size_of::<container>(),
+ 4usize,
+ concat!("Size of: ", stringify!(container))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<container>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(container))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const container)).contained as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(container),
+ "::",
+ stringify!(contained)
+ )
+ );
}
impl Clone for container {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs
index bd2a624e..6eb7b672 100644
--- a/tests/expectations/tests/opaque_pointer.rs
+++ b/tests/expectations/tests/opaque_pointer.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen opaque></div>
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -12,19 +13,26 @@ pub struct OtherOpaque {
}
#[test]
fn bindgen_test_layout_OtherOpaque() {
- assert_eq!(::std::mem::size_of::<OtherOpaque>() , 4usize , concat ! (
- "Size of: " , stringify ! ( OtherOpaque ) ));
- assert_eq! (::std::mem::align_of::<OtherOpaque>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( OtherOpaque ) ));
+ assert_eq!(
+ ::std::mem::size_of::<OtherOpaque>(),
+ 4usize,
+ concat!("Size of: ", stringify!(OtherOpaque))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<OtherOpaque>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(OtherOpaque))
+ );
}
impl Clone for OtherOpaque {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// <div rustbindgen opaque></div>
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
-pub struct Opaque {
-}
+pub struct Opaque {}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq)]
pub struct WithOpaquePtr {
@@ -34,29 +42,54 @@ pub struct WithOpaquePtr {
}
#[test]
fn bindgen_test_layout_WithOpaquePtr() {
- assert_eq!(::std::mem::size_of::<WithOpaquePtr>() , 16usize , concat ! (
- "Size of: " , stringify ! ( WithOpaquePtr ) ));
- assert_eq! (::std::mem::align_of::<WithOpaquePtr>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( WithOpaquePtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithOpaquePtr ) ) . whatever as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( WithOpaquePtr ) , "::"
- , stringify ! ( whatever ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithOpaquePtr ) ) . other as * const _ as
- usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( WithOpaquePtr ) , "::"
- , stringify ! ( other ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const WithOpaquePtr ) ) . t as * const _ as
- usize } , 12usize , concat ! (
- "Alignment of field: " , stringify ! ( WithOpaquePtr ) , "::"
- , stringify ! ( t ) ));
+ assert_eq!(
+ ::std::mem::size_of::<WithOpaquePtr>(),
+ 16usize,
+ concat!("Size of: ", stringify!(WithOpaquePtr))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<WithOpaquePtr>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(WithOpaquePtr))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WithOpaquePtr)).whatever as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WithOpaquePtr),
+ "::",
+ stringify!(whatever)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WithOpaquePtr)).other as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WithOpaquePtr),
+ "::",
+ stringify!(other)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const WithOpaquePtr)).t as *const _ as usize },
+ 12usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(WithOpaquePtr),
+ "::",
+ stringify!(t)
+ )
+ );
}
impl Clone for WithOpaquePtr {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for WithOpaquePtr {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/replace_template_alias.rs b/tests/expectations/tests/replace_template_alias.rs
index 8d837341..3ddde177 100644
--- a/tests/expectations/tests/replace_template_alias.rs
+++ b/tests/expectations/tests/replace_template_alias.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// But the replacement type does use T!
///
/// <div rustbindgen replaces="JS::detail::MaybeWrapped" />
@@ -14,6 +15,8 @@ pub struct JS_Rooted<T> {
pub ptr: JS_detail_MaybeWrapped<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for JS_Rooted<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for JS_Rooted<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/replace_use.rs b/tests/expectations/tests/replace_use.rs
index 2569f7ac..49185e32 100644
--- a/tests/expectations/tests/replace_use.rs
+++ b/tests/expectations/tests/replace_use.rs
@@ -4,6 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
/// <div rustbindgen replaces="nsTArray"></div>
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
@@ -17,25 +18,45 @@ pub struct Test {
}
#[test]
fn bindgen_test_layout_Test() {
- assert_eq!(::std::mem::size_of::<Test>() , 4usize , concat ! (
- "Size of: " , stringify ! ( Test ) ));
- assert_eq! (::std::mem::align_of::<Test>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Test ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Test ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Test ) , "::" ,
- stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Test>(),
+ 4usize,
+ concat!("Size of: ", stringify!(Test))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Test>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Test))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Test)).a as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Test),
+ "::",
+ stringify!(a)
+ )
+ );
}
impl Clone for Test {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[test]
fn __bindgen_test_layout_nsTArray_open0_long_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<nsTArray>() , 4usize , concat ! (
- "Size of template specialization: " , stringify ! ( nsTArray )
- ));
- assert_eq!(::std::mem::align_of::<nsTArray>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- nsTArray ) ));
+ assert_eq!(
+ ::std::mem::size_of::<nsTArray>(),
+ 4usize,
+ concat!("Size of template specialization: ", stringify!(nsTArray))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<nsTArray>(),
+ 4usize,
+ concat!(
+ "Alignment of template specialization: ",
+ stringify!(nsTArray)
+ )
+ );
}
diff --git a/tests/expectations/tests/struct_typedef_ns.rs b/tests/expectations/tests/struct_typedef_ns.rs
index 74c60923..e0dfe41d 100644
--- a/tests/expectations/tests/struct_typedef_ns.rs
+++ b/tests/expectations/tests/struct_typedef_ns.rs
@@ -18,24 +18,37 @@ pub mod root {
}
#[test]
fn bindgen_test_layout_typedef_struct() {
- assert_eq!(::std::mem::size_of::<typedef_struct>() , 4usize ,
- concat ! ( "Size of: " , stringify ! ( typedef_struct )
- ));
- assert_eq! (::std::mem::align_of::<typedef_struct>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( typedef_struct ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const typedef_struct ) ) . foo as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( typedef_struct
- ) , "::" , stringify ! ( foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<typedef_struct>(),
+ 4usize,
+ concat!("Size of: ", stringify!(typedef_struct))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<typedef_struct>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(typedef_struct))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const typedef_struct)).foo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(typedef_struct),
+ "::",
+ stringify!(foo)
+ )
+ );
}
impl Clone for typedef_struct {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
- pub enum typedef_enum { BAR = 1, }
+ pub enum typedef_enum {
+ BAR = 1,
+ }
}
pub mod _bindgen_mod_id_12 {
#[allow(unused_imports)]
@@ -47,29 +60,40 @@ pub mod root {
}
#[test]
fn bindgen_test_layout__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<_bindgen_ty_1>() , 4usize ,
- concat ! ( "Size of: " , stringify ! ( _bindgen_ty_1 )
- ));
- assert_eq! (::std::mem::align_of::<_bindgen_ty_1>() , 4usize ,
- concat ! (
- "Alignment of " , stringify ! ( _bindgen_ty_1 ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const _bindgen_ty_1 ) ) . foo as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( _bindgen_ty_1 )
- , "::" , stringify ! ( foo ) ));
+ assert_eq!(
+ ::std::mem::size_of::<_bindgen_ty_1>(),
+ 4usize,
+ concat!("Size of: ", stringify!(_bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<_bindgen_ty_1>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(_bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const _bindgen_ty_1)).foo as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(_bindgen_ty_1),
+ "::",
+ stringify!(foo)
+ )
+ );
}
impl Clone for _bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
pub type typedef_struct = root::_bindgen_mod_id_12::_bindgen_ty_1;
- pub const _bindgen_mod_id_12_BAR:
- root::_bindgen_mod_id_12::_bindgen_ty_2 =
+ pub const _bindgen_mod_id_12_BAR: root::_bindgen_mod_id_12::_bindgen_ty_2 =
_bindgen_ty_2::BAR;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
- pub enum _bindgen_ty_2 { BAR = 1, }
- pub use self::super::super::root::_bindgen_mod_id_12::_bindgen_ty_2 as
- typedef_enum;
+ pub enum _bindgen_ty_2 {
+ BAR = 1,
+ }
+ pub use self::super::super::root::_bindgen_mod_id_12::_bindgen_ty_2 as typedef_enum;
}
}
diff --git a/tests/expectations/tests/struct_with_bitfields.rs b/tests/expectations/tests/struct_with_bitfields.rs
index d874351b..0581d4f2 100644
--- a/tests/expectations/tests/struct_with_bitfields.rs
+++ b/tests/expectations/tests/struct_with_bitfields.rs
@@ -13,29 +13,42 @@ pub struct bitfield {
}
#[test]
fn bindgen_test_layout_bitfield() {
- assert_eq!(::std::mem::size_of::<bitfield>() , 16usize , concat ! (
- "Size of: " , stringify ! ( bitfield ) ));
- assert_eq! (::std::mem::align_of::<bitfield>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( bitfield ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const bitfield ) ) . e as * const _ as usize }
- , 4usize , concat ! (
- "Alignment of field: " , stringify ! ( bitfield ) , "::" ,
- stringify ! ( e ) ));
+ assert_eq!(
+ ::std::mem::size_of::<bitfield>(),
+ 16usize,
+ concat!("Size of: ", stringify!(bitfield))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<bitfield>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(bitfield))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const bitfield)).e as *const _ as usize },
+ 4usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(bitfield),
+ "::",
+ stringify!(e)
+ )
+ );
}
impl Clone for bitfield {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl bitfield {
#[inline]
pub fn a(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 1u64 as u8;
let val = (unit_field_val & mask) >> 0usize;
@@ -47,31 +60,31 @@ impl bitfield {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn b(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 2u64 as u8;
let val = (unit_field_val & mask) >> 1usize;
@@ -83,31 +96,31 @@ impl bitfield {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 1usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 4u64 as u8;
let val = (unit_field_val & mask) >> 2usize;
@@ -119,31 +132,31 @@ impl bitfield {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 2usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
pub fn d(&self) -> ::std::os::raw::c_ushort {
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
let mask = 192u64 as u8;
let val = (unit_field_val & mask) >> 6usize;
@@ -155,43 +168,43 @@ impl bitfield {
let val = val as u16 as u8;
let mut unit_field_val: u8 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u8 as
- *mut u8,
- ::std::mem::size_of::<u8>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u8 as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u8>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u8>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(a: ::std::os::raw::c_ushort,
- b: ::std::os::raw::c_ushort,
- c: ::std::os::raw::c_ushort,
- d: ::std::os::raw::c_ushort) -> u8 {
- ({
- ({
- ({ ({ 0 } | ((a as u16 as u8) << 0usize) & (1u64 as u8)) } |
- ((b as u16 as u8) << 1usize) & (2u64 as u8))
- } | ((c as u16 as u8) << 2usize) & (4u64 as u8))
- } | ((d as u16 as u8) << 6usize) & (192u64 as u8))
+ pub fn new_bitfield_1(
+ a: ::std::os::raw::c_ushort,
+ b: ::std::os::raw::c_ushort,
+ c: ::std::os::raw::c_ushort,
+ d: ::std::os::raw::c_ushort,
+ ) -> u8 {
+ ((((0 | ((a as u16 as u8) << 0usize) & (1u64 as u8)) |
+ ((b as u16 as u8) << 1usize) & (2u64 as u8)) |
+ ((c as u16 as u8) << 2usize) & (4u64 as u8)) |
+ ((d as u16 as u8) << 6usize) & (192u64 as u8))
}
#[inline]
pub fn f(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 3u64 as u64;
let val = (unit_field_val & mask) >> 0usize;
@@ -203,31 +216,31 @@ impl bitfield {
let val = val as u32 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
pub fn g(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
let mask = 18446744069414584320u64 as u64;
let val = (unit_field_val & mask) >> 32usize;
@@ -239,27 +252,25 @@ impl bitfield {
let val = val as u32 as u64;
let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u64 as
- *mut u8,
- ::std::mem::size_of::<u64>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u64 as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 32usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u64>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u64>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_2(f: ::std::os::raw::c_uint,
- g: ::std::os::raw::c_uint) -> u64 {
- ({ ({ 0 } | ((f as u32 as u64) << 0usize) & (3u64 as u64)) } |
- ((g as u32 as u64) << 32usize) &
- (18446744069414584320u64 as u64))
+ pub fn new_bitfield_2(f: ::std::os::raw::c_uint, g: ::std::os::raw::c_uint) -> u64 {
+ ((0 | ((f as u32 as u64) << 0usize) & (3u64 as u64)) |
+ ((g as u32 as u64) << 32usize) & (18446744069414584320u64 as u64))
}
}
diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs
index 4033f07b..067ed380 100644
--- a/tests/expectations/tests/template.rs
+++ b/tests/expectations/tests/template.rs
@@ -12,8 +12,10 @@ pub struct Foo<T> {
pub m_member_arr: [T; 1usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for Foo<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Foo<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -21,8 +23,10 @@ pub struct B<T> {
pub m_member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for B<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for B<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
extern "C" {
#[link_name = "_Z3bar3FooIiiE"]
@@ -54,90 +58,171 @@ pub struct C {
}
#[test]
fn bindgen_test_layout_C() {
- assert_eq!(::std::mem::size_of::<C>() , 96usize , concat ! (
- "Size of: " , stringify ! ( C ) ));
- assert_eq! (::std::mem::align_of::<C>() , 8usize , concat ! (
- "Alignment of " , stringify ! ( C ) ));
- assert_eq! (unsafe { & ( * ( 0 as * const C ) ) . mB as * const _ as usize
- } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mB ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstPtr as * const _ as usize
- } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstStructPtr as * const _ as
- usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstStructPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstStructPtrArray as * const
- _ as usize } , 24usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstStructPtrArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConst as * const _ as usize } ,
- 32usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConst ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBVolatile as * const _ as usize
- } , 36usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBVolatile ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstBool as * const _ as usize
- } , 40usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstBool ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstChar as * const _ as usize
- } , 42usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstChar ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBArray as * const _ as usize } ,
- 44usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBPtrArray as * const _ as usize
- } , 48usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBPtrArray ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBArrayPtr as * const _ as usize
- } , 56usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBArrayPtr ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBRef as * const _ as usize } ,
- 64usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBRef ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mBConstRef as * const _ as usize
- } , 72usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mBConstRef ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mPtrRef as * const _ as usize } ,
- 80usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mPtrRef ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const C ) ) . mArrayRef as * const _ as usize }
- , 88usize , concat ! (
- "Alignment of field: " , stringify ! ( C ) , "::" , stringify
- ! ( mArrayRef ) ));
+ assert_eq!(
+ ::std::mem::size_of::<C>(),
+ 96usize,
+ concat!("Size of: ", stringify!(C))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<C>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(C))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mB as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(C), "::", stringify!(mB))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstPtr as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstPtr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstStructPtr as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstStructPtr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstStructPtrArray as *const _ as usize },
+ 24usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstStructPtrArray)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConst as *const _ as usize },
+ 32usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConst)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBVolatile as *const _ as usize },
+ 36usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBVolatile)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstBool as *const _ as usize },
+ 40usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstBool)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstChar as *const _ as usize },
+ 42usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstChar)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBArray as *const _ as usize },
+ 44usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBArray)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBPtrArray as *const _ as usize },
+ 48usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBPtrArray)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBArrayPtr as *const _ as usize },
+ 56usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBArrayPtr)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBRef as *const _ as usize },
+ 64usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBRef)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mBConstRef as *const _ as usize },
+ 72usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mBConstRef)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mPtrRef as *const _ as usize },
+ 80usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mPtrRef)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const C)).mArrayRef as *const _ as usize },
+ 88usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(C),
+ "::",
+ stringify!(mArrayRef)
+ )
+ );
}
impl Clone for C {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for C {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
@@ -152,11 +237,15 @@ pub struct D_U<Z> {
pub m_baz: Z,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<Z>>,
}
-impl <Z> Default for D_U<Z> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<Z> Default for D_U<Z> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl Default for D {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -166,8 +255,10 @@ pub struct Rooted<T> {
pub ptr: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for Rooted<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for Rooted<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Hash, PartialEq, Eq)]
@@ -176,21 +267,36 @@ pub struct RootedContainer {
}
#[test]
fn bindgen_test_layout_RootedContainer() {
- assert_eq!(::std::mem::size_of::<RootedContainer>() , 24usize , concat ! (
- "Size of: " , stringify ! ( RootedContainer ) ));
- assert_eq! (::std::mem::align_of::<RootedContainer>() , 8usize , concat !
- ( "Alignment of " , stringify ! ( RootedContainer ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const RootedContainer ) ) . root as * const _
- as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( RootedContainer ) ,
- "::" , stringify ! ( root ) ));
+ assert_eq!(
+ ::std::mem::size_of::<RootedContainer>(),
+ 24usize,
+ concat!("Size of: ", stringify!(RootedContainer))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<RootedContainer>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(RootedContainer))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const RootedContainer)).root as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(RootedContainer),
+ "::",
+ stringify!(root)
+ )
+ );
}
impl Clone for RootedContainer {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for RootedContainer {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
pub type WithDtorIntFwd = WithDtor<::std::os::raw::c_int>;
#[repr(C)]
@@ -199,8 +305,10 @@ pub struct WithDtor<T> {
pub member: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for WithDtor<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for WithDtor<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
@@ -209,24 +317,36 @@ pub struct PODButContainsDtor {
}
#[test]
fn bindgen_test_layout_PODButContainsDtor() {
- assert_eq!(::std::mem::size_of::<PODButContainsDtor>() , 4usize , concat !
- ( "Size of: " , stringify ! ( PODButContainsDtor ) ));
- assert_eq! (::std::mem::align_of::<PODButContainsDtor>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( PODButContainsDtor ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const PODButContainsDtor ) ) . member as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( PODButContainsDtor ) ,
- "::" , stringify ! ( member ) ));
+ assert_eq!(
+ ::std::mem::size_of::<PODButContainsDtor>(),
+ 4usize,
+ concat!("Size of: ", stringify!(PODButContainsDtor))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<PODButContainsDtor>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(PODButContainsDtor))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const PODButContainsDtor)).member as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(PODButContainsDtor),
+ "::",
+ stringify!(member)
+ )
+ );
}
impl Default for PODButContainsDtor {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// <div rustbindgen opaque>
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
-pub struct Opaque {
-}
+pub struct Opaque {}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
pub struct POD {
@@ -234,18 +354,31 @@ pub struct POD {
}
#[test]
fn bindgen_test_layout_POD() {
- assert_eq!(::std::mem::size_of::<POD>() , 4usize , concat ! (
- "Size of: " , stringify ! ( POD ) ));
- assert_eq! (::std::mem::align_of::<POD>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( POD ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const POD ) ) . opaque_member as * const _ as
- usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( POD ) , "::" ,
- stringify ! ( opaque_member ) ));
+ assert_eq!(
+ ::std::mem::size_of::<POD>(),
+ 4usize,
+ concat!("Size of: ", stringify!(POD))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<POD>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(POD))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const POD)).opaque_member as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(POD),
+ "::",
+ stringify!(opaque_member)
+ )
+ );
}
impl Clone for POD {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
/// <div rustbindgen replaces="NestedReplaced"></div>
#[repr(C)]
@@ -254,8 +387,10 @@ pub struct NestedReplaced<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for NestedReplaced<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for NestedReplaced<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -263,8 +398,10 @@ pub struct NestedBase<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for NestedBase<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for NestedBase<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -275,7 +412,9 @@ pub struct NestedContainer<T> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl <T> Default for NestedContainer<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -284,7 +423,9 @@ pub struct Incomplete<T> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl <T> Default for Incomplete<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
@@ -293,13 +434,21 @@ pub struct Untemplated {
}
#[test]
fn bindgen_test_layout_Untemplated() {
- assert_eq!(::std::mem::size_of::<Untemplated>() , 1usize , concat ! (
- "Size of: " , stringify ! ( Untemplated ) ));
- assert_eq! (::std::mem::align_of::<Untemplated>() , 1usize , concat ! (
- "Alignment of " , stringify ! ( Untemplated ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Untemplated>(),
+ 1usize,
+ concat!("Size of: ", stringify!(Untemplated))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Untemplated>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(Untemplated))
+ );
}
impl Clone for Untemplated {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
@@ -316,8 +465,10 @@ pub struct ReplacedWithoutDestructor<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for ReplacedWithoutDestructor<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for ReplacedWithoutDestructor<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
@@ -325,8 +476,10 @@ pub struct ShouldNotBeCopiable<T> {
pub m_member: ReplacedWithoutDestructor<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for ShouldNotBeCopiable<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for ShouldNotBeCopiable<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
@@ -334,8 +487,10 @@ pub struct ShouldNotBeCopiableAsWell<U> {
pub m_member: ReplacedWithoutDestructorFwd<U>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<U>>,
}
-impl <U> Default for ShouldNotBeCopiableAsWell<U> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<U> Default for ShouldNotBeCopiableAsWell<U> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
/// If the replacement doesn't happen at the parse level the container would be
/// copy and the replacement wouldn't, so this wouldn't compile.
@@ -347,222 +502,115 @@ pub struct ReplacedWithoutDestructorFwd<T> {
pub buff: *mut T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl <T> Default for ReplacedWithoutDestructorFwd<T> {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+impl<T> Default for ReplacedWithoutDestructorFwd<T> {
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
#[test]
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<Foo<::std::os::raw::c_int>>() , 24usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- Foo<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<Foo<::std::os::raw::c_int>>() , 8usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- Foo<::std::os::raw::c_int> ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Foo<::std::os::raw::c_int>>(),
+ 24usize,
+ concat!(
+ "Size of template specialization: ",
+ stringify ! ( Foo < :: std :: os :: raw :: c_int > )
+ )
+ );
+ assert_eq ! ( :: std :: mem :: align_of :: < Foo < :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( Foo < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_unsigned_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<::std::os::raw::c_uint>>() , 4usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- B<::std::os::raw::c_uint> ) ));
- assert_eq!(::std::mem::align_of::<B<::std::os::raw::c_uint>>() , 4usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<::std::os::raw::c_uint> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < :: std :: os :: raw :: c_uint > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_uint > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < :: std :: os :: raw :: c_uint > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_uint > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_const_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*const ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*const ::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<*const ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*const ::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * const :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * const :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * const :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * const :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_const_mozilla__Foo_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*const mozilla_Foo>>() , 8usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- B<*const mozilla_Foo> ) ));
- assert_eq!(::std::mem::align_of::<B<*const mozilla_Foo>>() , 8usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*const mozilla_Foo> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * const mozilla_Foo > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * const mozilla_Foo > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * const mozilla_Foo > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * const mozilla_Foo > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_array1_ptr_const_mozilla__Foo_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<[*const mozilla_Foo; 1usize]>>() ,
- 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<[*const mozilla_Foo; 1usize]> ) ));
- assert_eq!(::std::mem::align_of::<B<[*const mozilla_Foo; 1usize]>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<[*const mozilla_Foo; 1usize]> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < [ * const mozilla_Foo ; 1usize ] > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < [ * const mozilla_Foo ; 1usize ] > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < [ * const mozilla_Foo ; 1usize ] > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < [ * const mozilla_Foo ; 1usize ] > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_const_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- B<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_volatile_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- B<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<::std::os::raw::c_int>>() , 4usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_const_bool_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<bool>>() , 1usize , concat ! (
- "Size of template specialization: " , stringify ! ( B<bool> )
- ));
- assert_eq!(::std::mem::align_of::<B<bool>>() , 1usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<bool> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < bool > > ( ) , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( B < bool > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < bool > > ( ) , 1usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < bool > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_const_char16_t_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<u16>>() , 2usize , concat ! (
- "Size of template specialization: " , stringify ! ( B<u16> )
- ));
- assert_eq!(::std::mem::align_of::<B<u16>>() , 2usize , concat ! (
- "Alignment of template specialization: " , stringify ! ( B<u16>
- ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < u16 > > ( ) , 2usize , concat ! ( "Size of template specialization: " , stringify ! ( B < u16 > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < u16 > > ( ) , 2usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < u16 > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_array1_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<[::std::os::raw::c_int; 1usize]>>() ,
- 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<[::std::os::raw::c_int; 1usize]> ) ));
- assert_eq!(::std::mem::align_of::<B<[::std::os::raw::c_int; 1usize]>>() ,
- 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<[::std::os::raw::c_int; 1usize]> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( B < [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_array1_ptr_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<[*mut ::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<[*mut ::std::os::raw::c_int; 1usize]> ) ));
- assert_eq!(::std::mem::align_of::<B<[*mut ::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<[*mut ::std::os::raw::c_int; 1usize]> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < [ * mut :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < [ * mut :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < [ * mut :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < [ * mut :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ptr_array1_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*mut [::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*mut [::std::os::raw::c_int; 1usize]> ) ));
- assert_eq!(::std::mem::align_of::<B<*mut [::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*mut [::std::os::raw::c_int; 1usize]> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ref_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*mut ::std::os::raw::c_int>>() , 8usize
- , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*mut ::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<*mut ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*mut ::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * mut :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * mut :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * mut :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * mut :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ref_const_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*const ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*const ::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<*const ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*const ::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * const :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * const :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * const :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * const :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ref_ptr_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*mut *mut ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*mut *mut ::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<B<*mut *mut ::std::os::raw::c_int>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*mut *mut ::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * mut * mut :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * mut * mut :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * mut * mut :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * mut * mut :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_B_open0_ref_array1_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<B<*mut [::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- B<*mut [::std::os::raw::c_int; 1usize]> ) ));
- assert_eq!(::std::mem::align_of::<B<*mut [::std::os::raw::c_int; 1usize]>>()
- , 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- B<*mut [::std::os::raw::c_int; 1usize]> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( B < * mut [ :: std :: os :: raw :: c_int ; 1usize ] > ) ) );
}
#[test]
fn __bindgen_test_layout_Foo_open0_int_int_close0_instantiation_1() {
- assert_eq!(::std::mem::size_of::<Foo<::std::os::raw::c_int>>() , 24usize ,
- concat ! (
- "Size of template specialization: " , stringify ! (
- Foo<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<Foo<::std::os::raw::c_int>>() , 8usize ,
- concat ! (
- "Alignment of template specialization: " , stringify ! (
- Foo<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < Foo < :: std :: os :: raw :: c_int > > ( ) , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( Foo < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < Foo < :: std :: os :: raw :: c_int > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( Foo < :: std :: os :: raw :: c_int > ) ) );
}
#[test]
fn __bindgen_test_layout_Rooted_open0_ptr_void_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<Rooted<*mut ::std::os::raw::c_void>>() ,
- 24usize , concat ! (
- "Size of template specialization: " , stringify ! (
- Rooted<*mut ::std::os::raw::c_void> ) ));
- assert_eq!(::std::mem::align_of::<Rooted<*mut ::std::os::raw::c_void>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- Rooted<*mut ::std::os::raw::c_void> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < Rooted < * mut :: std :: os :: raw :: c_void > > ( ) , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( Rooted < * mut :: std :: os :: raw :: c_void > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < Rooted < * mut :: std :: os :: raw :: c_void > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( Rooted < * mut :: std :: os :: raw :: c_void > ) ) );
}
#[test]
fn __bindgen_test_layout_Rooted_open0_ptr_void_close0_instantiation_1() {
- assert_eq!(::std::mem::size_of::<Rooted<*mut ::std::os::raw::c_void>>() ,
- 24usize , concat ! (
- "Size of template specialization: " , stringify ! (
- Rooted<*mut ::std::os::raw::c_void> ) ));
- assert_eq!(::std::mem::align_of::<Rooted<*mut ::std::os::raw::c_void>>() ,
- 8usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- Rooted<*mut ::std::os::raw::c_void> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < Rooted < * mut :: std :: os :: raw :: c_void > > ( ) , 24usize , concat ! ( "Size of template specialization: " , stringify ! ( Rooted < * mut :: std :: os :: raw :: c_void > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < Rooted < * mut :: std :: os :: raw :: c_void > > ( ) , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( Rooted < * mut :: std :: os :: raw :: c_void > ) ) );
}
#[test]
fn __bindgen_test_layout_WithDtor_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<WithDtor<::std::os::raw::c_int>>() ,
- 4usize , concat ! (
- "Size of template specialization: " , stringify ! (
- WithDtor<::std::os::raw::c_int> ) ));
- assert_eq!(::std::mem::align_of::<WithDtor<::std::os::raw::c_int>>() ,
- 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- WithDtor<::std::os::raw::c_int> ) ));
+ assert_eq ! ( :: std :: mem :: size_of :: < WithDtor < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( WithDtor < :: std :: os :: raw :: c_int > ) ) );
+ assert_eq ! ( :: std :: mem :: align_of :: < WithDtor < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( WithDtor < :: std :: os :: raw :: c_int > ) ) );
}
diff --git a/tests/expectations/tests/template_typedefs.rs b/tests/expectations/tests/template_typedefs.rs
index d18783ad..df16f9f6 100644
--- a/tests/expectations/tests/template_typedefs.rs
+++ b/tests/expectations/tests/template_typedefs.rs
@@ -4,8 +4,7 @@
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
-pub type foo =
- ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
+pub type foo = ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Foo {
@@ -13,8 +12,6 @@ pub struct Foo {
}
pub type Foo_Char<T> = T;
pub type Foo_FooPtrTypedef<T> = *mut Foo_Char<T>;
-pub type Foo_nsCOMArrayEnumFunc<T> =
- ::std::option::Option<unsafe extern "C" fn(aElement: *mut T,
- aData:
- *mut ::std::os::raw::c_void)
- -> bool>;
+pub type Foo_nsCOMArrayEnumFunc<T> = ::std::option::Option<
+ unsafe extern "C" fn(aElement: *mut T, aData: *mut ::std::os::raw::c_void) -> bool,
+>;
diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/tests/expectations/tests/union_with_anon_struct_bitfield.rs
index c258f901..3c903028 100644
--- a/tests/expectations/tests/union_with_anon_struct_bitfield.rs
+++ b/tests/expectations/tests/union_with_anon_struct_bitfield.rs
@@ -19,24 +19,32 @@ pub struct foo__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
- ( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo__bindgen_ty_1>(),
+ 4usize,
+ concat!("Size of: ", stringify!(foo__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo__bindgen_ty_1>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo__bindgen_ty_1))
+ );
}
impl Clone for foo__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl foo__bindgen_ty_1 {
#[inline]
pub fn b(&self) -> ::std::os::raw::c_int {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 127u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -48,31 +56,31 @@ impl foo__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_int {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 4294967168u64 as u32;
let val = (unit_field_val & mask) >> 7usize;
@@ -84,44 +92,53 @@ impl foo__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(b: ::std::os::raw::c_int, c: ::std::os::raw::c_int)
- -> u32 {
- ({ ({ 0 } | ((b as u32 as u32) << 0usize) & (127u64 as u32)) } |
- ((c as u32 as u32) << 7usize) & (4294967168u64 as u32))
+ pub fn new_bitfield_1(b: ::std::os::raw::c_int, c: ::std::os::raw::c_int) -> u32 {
+ ((0 | ((b as u32 as u32) << 0usize) & (127u64 as u32)) |
+ ((c as u32 as u32) << 7usize) & (4294967168u64 as u32))
}
}
#[test]
fn bindgen_test_layout_foo() {
- assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
- "Size of: " , stringify ! ( foo ) ));
- assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo>(),
+ 4usize,
+ concat!("Size of: ", stringify!(foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo)).a as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a))
+ );
}
impl Clone for foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for foo {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs b/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs
index 53faf3a4..2b5ffbac 100644
--- a/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs
+++ b/tests/expectations/tests/union_with_anon_struct_bitfield_1_0.rs
@@ -6,33 +6,45 @@
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
-impl <T> __BindgenUnionField<T> {
+impl<T> __BindgenUnionField<T> {
#[inline]
- pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
+ pub fn new() -> Self {
+ __BindgenUnionField(::std::marker::PhantomData)
+ }
#[inline]
- pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
+ pub unsafe fn as_ref(&self) -> &T {
+ ::std::mem::transmute(self)
+ }
#[inline]
- pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
+ pub unsafe fn as_mut(&mut self) -> &mut T {
+ ::std::mem::transmute(self)
+ }
}
-impl <T> ::std::default::Default for __BindgenUnionField<T> {
+impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
- fn default() -> Self { Self::new() }
+ fn default() -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
+impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
- fn clone(&self) -> Self { Self::new() }
+ fn clone(&self) -> Self {
+ Self::new()
+ }
}
-impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
-impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
+impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
+impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
-impl <T> ::std::hash::Hash for __BindgenUnionField<T> {
- fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) { }
+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 }
+impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
+ fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
+ true
+ }
}
impl <T> ::std::cmp::Eq for __BindgenUnionField<T> { }
#[repr(C)]
@@ -50,24 +62,32 @@ pub struct foo__bindgen_ty_1 {
}
#[test]
fn bindgen_test_layout_foo__bindgen_ty_1() {
- assert_eq!(::std::mem::size_of::<foo__bindgen_ty_1>() , 4usize , concat !
- ( "Size of: " , stringify ! ( foo__bindgen_ty_1 ) ));
- assert_eq! (::std::mem::align_of::<foo__bindgen_ty_1>() , 4usize , concat
- ! ( "Alignment of " , stringify ! ( foo__bindgen_ty_1 ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo__bindgen_ty_1>(),
+ 4usize,
+ concat!("Size of: ", stringify!(foo__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo__bindgen_ty_1>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo__bindgen_ty_1))
+ );
}
impl Clone for foo__bindgen_ty_1 {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl foo__bindgen_ty_1 {
#[inline]
pub fn b(&self) -> ::std::os::raw::c_int {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 127u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -79,31 +99,31 @@ impl foo__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn c(&self) -> ::std::os::raw::c_int {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 4294967168u64 as u32;
let val = (unit_field_val & mask) >> 7usize;
@@ -115,41 +135,48 @@ impl foo__bindgen_ty_1 {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(b: ::std::os::raw::c_int, c: ::std::os::raw::c_int)
- -> u32 {
- ({ ({ 0 } | ((b as u32 as u32) << 0usize) & (127u64 as u32)) } |
- ((c as u32 as u32) << 7usize) & (4294967168u64 as u32))
+ pub fn new_bitfield_1(b: ::std::os::raw::c_int, c: ::std::os::raw::c_int) -> u32 {
+ ((0 | ((b as u32 as u32) << 0usize) & (127u64 as u32)) |
+ ((c as u32 as u32) << 7usize) & (4294967168u64 as u32))
}
}
#[test]
fn bindgen_test_layout_foo() {
- assert_eq!(::std::mem::size_of::<foo>() , 4usize , concat ! (
- "Size of: " , stringify ! ( foo ) ));
- assert_eq! (::std::mem::align_of::<foo>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( foo ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const foo ) ) . a as * const _ as usize } ,
- 0usize , concat ! (
- "Alignment of field: " , stringify ! ( foo ) , "::" ,
- stringify ! ( a ) ));
+ assert_eq!(
+ ::std::mem::size_of::<foo>(),
+ 4usize,
+ concat!("Size of: ", stringify!(foo))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<foo>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(foo))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const foo)).a as *const _ as usize },
+ 0usize,
+ concat!("Alignment of field: ", stringify!(foo), "::", stringify!(a))
+ );
}
impl Clone for foo {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
diff --git a/tests/expectations/tests/weird_bitfields.rs b/tests/expectations/tests/weird_bitfields.rs
index 0b97c368..06f3af34 100644
--- a/tests/expectations/tests/weird_bitfields.rs
+++ b/tests/expectations/tests/weird_bitfields.rs
@@ -32,87 +32,157 @@ pub struct Weird {
}
#[test]
fn bindgen_test_layout_Weird() {
- assert_eq!(::std::mem::size_of::<Weird>() , 24usize , concat ! (
- "Size of: " , stringify ! ( Weird ) ));
- assert_eq! (::std::mem::align_of::<Weird>() , 4usize , concat ! (
- "Alignment of " , stringify ! ( Weird ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mStrokeDasharrayLength as *
- const _ as usize } , 0usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mStrokeDasharrayLength ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mClipRule as * const _ as
- usize } , 8usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mClipRule ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mColorInterpolation as *
- const _ as usize } , 9usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mColorInterpolation ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mColorInterpolationFilters as
- * const _ as usize } , 10usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mColorInterpolationFilters ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mFillRule as * const _ as
- usize } , 11usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mFillRule ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mImageRendering as * const _
- as usize } , 12usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mImageRendering ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mPaintOrder as * const _ as
- usize } , 13usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mPaintOrder ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mShapeRendering as * const _
- as usize } , 14usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mShapeRendering ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mStrokeLinecap as * const _
- as usize } , 15usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mStrokeLinecap ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mStrokeLinejoin as * const _
- as usize } , 16usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mStrokeLinejoin ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mTextAnchor as * const _ as
- usize } , 17usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mTextAnchor ) ));
- assert_eq! (unsafe {
- & ( * ( 0 as * const Weird ) ) . mTextRendering as * const _
- as usize } , 18usize , concat ! (
- "Alignment of field: " , stringify ! ( Weird ) , "::" ,
- stringify ! ( mTextRendering ) ));
+ assert_eq!(
+ ::std::mem::size_of::<Weird>(),
+ 24usize,
+ concat!("Size of: ", stringify!(Weird))
+ );
+ assert_eq!(
+ ::std::mem::align_of::<Weird>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(Weird))
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mStrokeDasharrayLength as *const _ as usize },
+ 0usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mStrokeDasharrayLength)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mClipRule as *const _ as usize },
+ 8usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mClipRule)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mColorInterpolation as *const _ as usize },
+ 9usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mColorInterpolation)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mColorInterpolationFilters as *const _ as usize },
+ 10usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mColorInterpolationFilters)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mFillRule as *const _ as usize },
+ 11usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mFillRule)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mImageRendering as *const _ as usize },
+ 12usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mImageRendering)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mPaintOrder as *const _ as usize },
+ 13usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mPaintOrder)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mShapeRendering as *const _ as usize },
+ 14usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mShapeRendering)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mStrokeLinecap as *const _ as usize },
+ 15usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mStrokeLinecap)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mStrokeLinejoin as *const _ as usize },
+ 16usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mStrokeLinejoin)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mTextAnchor as *const _ as usize },
+ 17usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mTextAnchor)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(0 as *const Weird)).mTextRendering as *const _ as usize },
+ 18usize,
+ concat!(
+ "Alignment of field: ",
+ stringify!(Weird),
+ "::",
+ stringify!(mTextRendering)
+ )
+ );
}
impl Clone for Weird {
- fn clone(&self) -> Self { *self }
+ fn clone(&self) -> Self {
+ *self
+ }
}
impl Default for Weird {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+ fn default() -> Self {
+ unsafe { ::std::mem::zeroed() }
+ }
}
impl Weird {
#[inline]
pub fn bitTest(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 65535u64 as u32;
let val = (unit_field_val & mask) >> 0usize;
@@ -124,31 +194,31 @@ impl Weird {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
pub fn bitTest2(&self) -> ::std::os::raw::c_uint {
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
let mask = 2147418112u64 as u32;
let val = (unit_field_val & mask) >> 16usize;
@@ -160,37 +230,39 @@ impl Weird {
let val = val as u32 as u32;
let mut unit_field_val: u32 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u32 as
- *mut u8,
- ::std::mem::size_of::<u32>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_1 as *const _ as *const u8,
+ &mut unit_field_val as *mut u32 as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 16usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_1 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u32>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_1 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u32>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_1(bitTest: ::std::os::raw::c_uint,
- bitTest2: ::std::os::raw::c_uint) -> u32 {
- ({ ({ 0 } | ((bitTest as u32 as u32) << 0usize) & (65535u64 as u32)) }
- | ((bitTest2 as u32 as u32) << 16usize) & (2147418112u64 as u32))
+ pub fn new_bitfield_1(
+ bitTest: ::std::os::raw::c_uint,
+ bitTest2: ::std::os::raw::c_uint,
+ ) -> u32 {
+ ((0 | ((bitTest as u32 as u32) << 0usize) & (65535u64 as u32)) |
+ ((bitTest2 as u32 as u32) << 16usize) & (2147418112u64 as u32))
}
#[inline]
pub fn mFillOpacitySource(&self) -> nsStyleSVGOpacitySource {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 7u64 as u16;
let val = (unit_field_val & mask) >> 0usize;
@@ -202,31 +274,31 @@ impl Weird {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 0usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn mStrokeOpacitySource(&self) -> nsStyleSVGOpacitySource {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 56u64 as u16;
let val = (unit_field_val & mask) >> 3usize;
@@ -238,31 +310,31 @@ impl Weird {
let val = val as u32 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 3usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn mStrokeDasharrayFromObject(&self) -> bool {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 64u64 as u16;
let val = (unit_field_val & mask) >> 6usize;
@@ -274,31 +346,31 @@ impl Weird {
let val = val as u8 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 6usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn mStrokeDashoffsetFromObject(&self) -> bool {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 128u64 as u16;
let val = (unit_field_val & mask) >> 7usize;
@@ -310,31 +382,31 @@ impl Weird {
let val = val as u8 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 7usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
pub fn mStrokeWidthFromObject(&self) -> bool {
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
let mask = 256u64 as u16;
let val = (unit_field_val & mask) >> 8usize;
@@ -346,46 +418,34 @@ impl Weird {
let val = val as u8 as u16;
let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() };
unsafe {
- ::std::ptr::copy_nonoverlapping(&self._bitfield_2 as *const _ as
- *const u8,
- &mut unit_field_val as *mut u16 as
- *mut u8,
- ::std::mem::size_of::<u16>())
+ ::std::ptr::copy_nonoverlapping(
+ &self._bitfield_2 as *const _ as *const u8,
+ &mut unit_field_val as *mut u16 as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ )
};
unit_field_val &= !mask;
unit_field_val |= (val << 8usize) & mask;
unsafe {
- ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as
- *const u8,
- &mut self._bitfield_2 as *mut _ as
- *mut u8,
- ::std::mem::size_of::<u16>());
+ ::std::ptr::copy_nonoverlapping(
+ &unit_field_val as *const _ as *const u8,
+ &mut self._bitfield_2 as *mut _ as *mut u8,
+ ::std::mem::size_of::<u16>(),
+ );
}
}
#[inline]
- pub fn new_bitfield_2(mFillOpacitySource: nsStyleSVGOpacitySource,
- mStrokeOpacitySource: nsStyleSVGOpacitySource,
- mStrokeDasharrayFromObject: bool,
- mStrokeDashoffsetFromObject: bool,
- mStrokeWidthFromObject: bool) -> u16 {
- ({
- ({
- ({
- ({
- ({ 0 } |
- ((mFillOpacitySource as u32 as u16) <<
- 0usize) & (7u64 as u16))
- } |
- ((mStrokeOpacitySource as u32 as u16) << 3usize) &
- (56u64 as u16))
- } |
- ((mStrokeDasharrayFromObject as u8 as u16) << 6usize) &
- (64u64 as u16))
- } |
- ((mStrokeDashoffsetFromObject as u8 as u16) << 7usize) &
- (128u64 as u16))
- } |
- ((mStrokeWidthFromObject as u8 as u16) << 8usize) &
- (256u64 as u16))
+ pub fn new_bitfield_2(
+ mFillOpacitySource: nsStyleSVGOpacitySource,
+ mStrokeOpacitySource: nsStyleSVGOpacitySource,
+ mStrokeDasharrayFromObject: bool,
+ mStrokeDashoffsetFromObject: bool,
+ mStrokeWidthFromObject: bool,
+ ) -> u16 {
+ (((((0 | ((mFillOpacitySource as u32 as u16) << 0usize) & (7u64 as u16)) |
+ ((mStrokeOpacitySource as u32 as u16) << 3usize) & (56u64 as u16)) |
+ ((mStrokeDasharrayFromObject as u8 as u16) << 6usize) & (64u64 as u16)) |
+ ((mStrokeDashoffsetFromObject as u8 as u16) << 7usize) & (128u64 as u16)) |
+ ((mStrokeWidthFromObject as u8 as u16) << 8usize) & (256u64 as u16))
}
}
diff --git a/tests/headers/nsBaseHashtable.hpp b/tests/headers/nsBaseHashtable.hpp
new file mode 100644
index 00000000..36a480f2
--- /dev/null
+++ b/tests/headers/nsBaseHashtable.hpp
@@ -0,0 +1,48 @@
+// bindgen-flags: -- -std=c++14
+
+using uint32_t = unsigned long;
+using size_t = unsigned long long;
+
+template<class KeyClass, class DataType>
+class nsBaseHashtableET {
+};
+
+template<class Entry>
+class nsTHashtable {
+};
+
+template<class KeyClass, class DataType, class UserDataType>
+class nsBaseHashtable
+ : protected nsTHashtable<nsBaseHashtableET<KeyClass, DataType>>
+{
+
+public:
+ typedef typename KeyClass::KeyType KeyType;
+ typedef nsBaseHashtableET<KeyClass, DataType> EntryType;
+
+ using nsTHashtable<EntryType>::Contains;
+ using nsTHashtable<EntryType>::GetGeneration;
+
+ nsBaseHashtable() {}
+ explicit nsBaseHashtable(uint32_t);
+
+ struct LookupResult {
+ private:
+ EntryType* mEntry;
+ nsBaseHashtable& mTable;
+
+ public:
+ LookupResult(EntryType*, nsBaseHashtable&);
+ };
+
+ struct EntryPtr {
+ private:
+ EntryType& mEntry;
+ bool mExistingEntry;
+
+ public:
+ EntryPtr(nsBaseHashtable&, EntryType*, bool);
+ ~EntryPtr();
+ };
+
+};
diff --git a/tests/rustfmt.toml b/tests/rustfmt.toml
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/rustfmt.toml
diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs
index dfbfa9e3..56bfcaa8 100755
--- a/tests/stylo_sanity.rs
+++ b/tests/stylo_sanity.rs
@@ -1,3 +1,5 @@
+// Don't want to copy that nasty `cfg` below...
+#[allow(unused_extern_crates)]
extern crate bindgen;
/// A sanity test that we can generate bindings for Stylo.
@@ -13,528 +15,529 @@ extern crate bindgen;
/// takes too long to be a proper `#[bench]`.
#[test]
#[cfg(not(any(debug_assertions,
- feature = "testing_only_extra_assertions",
- feature = "testing_only_libclang_3_8")))]
+ feature = "testing_only_extra_assertions",
+ feature = "testing_only_libclang_3_8")))]
#[cfg(any(feature = "testing_only_libclang_3_9",
- feature = "testing_only_libclang_4"))]
+ feature = "testing_only_libclang_4"))]
fn sanity_check_can_generate_stylo_bindings() {
use std::time::Instant;
let then = Instant::now();
- bindgen::builder()
- .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/stylo.hpp"))
- .whitelisted_function("Servo_.*")
- .whitelisted_function("Gecko_.*")
- .hide_type("nsACString_internal")
- .hide_type("nsAString_internal")
- .hide_type("mozilla::css::URLValue")
- .hide_type("RawGeckoAnimationPropertySegment")
- .hide_type("RawGeckoComputedTiming")
- .hide_type("RawGeckoDocument")
- .hide_type("RawGeckoElement")
- .hide_type("RawGeckoKeyframeList")
- .hide_type("RawGeckoComputedKeyframeValuesList")
- .hide_type("RawGeckoFontFaceRuleList")
- .hide_type("RawGeckoNode")
- .hide_type("RawGeckoAnimationValueList")
- .hide_type("RawServoAnimationValue")
- .hide_type("RawServoAnimationValueMap")
- .hide_type("RawServoDeclarationBlock")
- .hide_type("RawGeckoPresContext")
- .hide_type("RawGeckoPresContextOwned")
- .hide_type("RawGeckoStyleAnimationList")
- .hide_type("RawGeckoURLExtraData")
- .hide_type("RefPtr")
- .hide_type("CSSPseudoClassType")
- .hide_type("TraversalRootBehavior")
- .hide_type("ComputedTimingFunction_BeforeFlag")
- .hide_type("FontFamilyList")
- .hide_type("FontFamilyType")
- .hide_type("Keyframe")
- .hide_type("ServoBundledURI")
- .hide_type("ServoElementSnapshot")
- .hide_type("SheetParsingMode")
- .hide_type("StyleBasicShape")
- .hide_type("StyleBasicShapeType")
- .hide_type("StyleShapeSource")
- .hide_type("nsCSSFontFaceRule")
- .hide_type("nsCSSKeyword")
- .hide_type("nsCSSPropertyID")
- .hide_type("nsCSSShadowArray")
- .hide_type("nsCSSUnit")
- .hide_type("nsCSSValue")
- .hide_type("nsCSSValueSharedList")
- .hide_type("nsChangeHint")
- .hide_type("nsCursorImage")
- .hide_type("nsFont")
- .hide_type("nsIAtom")
- .hide_type("nsMediaFeature")
- .hide_type("nsRestyleHint")
- .hide_type("nsStyleBackground")
- .hide_type("nsStyleBorder")
- .hide_type("nsStyleColor")
- .hide_type("nsStyleColumn")
- .hide_type("nsStyleContent")
- .hide_type("nsStyleContentData")
- .hide_type("nsStyleContentType")
- .hide_type("nsStyleContext")
- .hide_type("nsStyleCoord")
- .hide_type("nsStyleCoord_Calc")
- .hide_type("nsStyleCoord_CalcValue")
- .hide_type("nsStyleDisplay")
- .hide_type("nsStyleEffects")
- .hide_type("nsStyleFilter")
- .hide_type("nsStyleFont")
- .hide_type("nsStyleGradient")
- .hide_type("nsStyleGradientStop")
- .hide_type("nsStyleImage")
- .hide_type("nsStyleImageLayers")
- .hide_type("nsStyleImageLayers_Layer")
- .hide_type("nsStyleImageLayers_LayerType")
- .hide_type("nsStyleImageRequest")
- .hide_type("nsStyleList")
- .hide_type("nsStyleMargin")
- .hide_type("nsStyleOutline")
- .hide_type("nsStylePadding")
- .hide_type("nsStylePosition")
- .hide_type("nsStyleQuoteValues")
- .hide_type("nsStyleSVG")
- .hide_type("nsStyleSVGPaint")
- .hide_type("nsStyleSVGReset")
- .hide_type("nsStyleTable")
- .hide_type("nsStyleTableBorder")
- .hide_type("nsStyleText")
- .hide_type("nsStyleTextReset")
- .hide_type("nsStyleUIReset")
- .hide_type("nsStyleUnion")
- .hide_type("nsStyleUnit")
- .hide_type("nsStyleUserInterface")
- .hide_type("nsStyleVariables")
- .hide_type("nsStyleVisibility")
- .hide_type("nsStyleXUL")
- .hide_type("nsTimingFunction")
- .hide_type("nscolor")
- .hide_type("nscoord")
- .hide_type("nsresult")
- .hide_type("Loader")
- .hide_type("ServoStyleSheet")
- .hide_type("EffectCompositor_CascadeLevel")
- .hide_type("UpdateAnimationsTasks")
- .hide_type("nsTArrayBorrowed_uintptr_t")
- .hide_type("ServoCssRulesStrong")
- .hide_type("ServoCssRulesBorrowed")
- .hide_type("ServoCssRulesBorrowedOrNull")
- .hide_type("ServoCssRules")
- .hide_type("RawServoStyleSheetStrong")
- .hide_type("RawServoStyleSheetBorrowed")
- .hide_type("RawServoStyleSheetBorrowedOrNull")
- .hide_type("RawServoStyleSheet")
- .hide_type("ServoComputedValuesStrong")
- .hide_type("ServoComputedValuesBorrowed")
- .hide_type("ServoComputedValuesBorrowedOrNull")
- .hide_type("ServoComputedValues")
- .hide_type("RawServoDeclarationBlockStrong")
- .hide_type("RawServoDeclarationBlockBorrowed")
- .hide_type("RawServoDeclarationBlockBorrowedOrNull")
- .hide_type("RawServoStyleRuleStrong")
- .hide_type("RawServoStyleRuleBorrowed")
- .hide_type("RawServoStyleRuleBorrowedOrNull")
- .hide_type("RawServoStyleRule")
- .hide_type("RawServoImportRuleStrong")
- .hide_type("RawServoImportRuleBorrowed")
- .hide_type("RawServoImportRuleBorrowedOrNull")
- .hide_type("RawServoImportRule")
- .hide_type("RawServoAnimationValueStrong")
- .hide_type("RawServoAnimationValueBorrowed")
- .hide_type("RawServoAnimationValueBorrowedOrNull")
- .hide_type("RawServoAnimationValueMapStrong")
- .hide_type("RawServoAnimationValueMapBorrowed")
- .hide_type("RawServoAnimationValueMapBorrowedOrNull")
- .hide_type("RawServoMediaListStrong")
- .hide_type("RawServoMediaListBorrowed")
- .hide_type("RawServoMediaListBorrowedOrNull")
- .hide_type("RawServoMediaList")
- .hide_type("RawServoMediaRuleStrong")
- .hide_type("RawServoMediaRuleBorrowed")
- .hide_type("RawServoMediaRuleBorrowedOrNull")
- .hide_type("RawServoMediaRule")
- .hide_type("RawServoNamespaceRuleStrong")
- .hide_type("RawServoNamespaceRuleBorrowed")
- .hide_type("RawServoNamespaceRuleBorrowedOrNull")
- .hide_type("RawServoNamespaceRule")
- .hide_type("RawServoStyleSetOwned")
- .hide_type("RawServoStyleSetOwnedOrNull")
- .hide_type("RawServoStyleSetBorrowed")
- .hide_type("RawServoStyleSetBorrowedOrNull")
- .hide_type("RawServoStyleSetBorrowedMut")
- .hide_type("RawServoStyleSetBorrowedMutOrNull")
- .hide_type("RawServoStyleSet")
- .hide_type("StyleChildrenIteratorOwned")
- .hide_type("StyleChildrenIteratorOwnedOrNull")
- .hide_type("StyleChildrenIteratorBorrowed")
- .hide_type("StyleChildrenIteratorBorrowedOrNull")
- .hide_type("StyleChildrenIteratorBorrowedMut")
- .hide_type("StyleChildrenIteratorBorrowedMutOrNull")
- .hide_type("StyleChildrenIterator")
- .hide_type("ServoElementSnapshotOwned")
- .hide_type("ServoElementSnapshotOwnedOrNull")
- .hide_type("ServoElementSnapshotBorrowed")
- .hide_type("ServoElementSnapshotBorrowedOrNull")
- .hide_type("ServoElementSnapshotBorrowedMut")
- .hide_type("ServoElementSnapshotBorrowedMutOrNull")
- .hide_type("RawGeckoNodeBorrowed")
- .hide_type("RawGeckoNodeBorrowedOrNull")
- .hide_type("RawGeckoElementBorrowed")
- .hide_type("RawGeckoElementBorrowedOrNull")
- .hide_type("RawGeckoDocumentBorrowed")
- .hide_type("RawGeckoDocumentBorrowedOrNull")
- .hide_type("RawServoDeclarationBlockStrongBorrowed")
- .hide_type("RawServoDeclarationBlockStrongBorrowedOrNull")
- .hide_type("RawGeckoPresContextBorrowed")
- .hide_type("RawGeckoPresContextBorrowedOrNull")
- .hide_type("RawGeckoStyleAnimationListBorrowed")
- .hide_type("RawGeckoStyleAnimationListBorrowedOrNull")
- .hide_type("nsCSSValueBorrowed")
- .hide_type("nsCSSValueBorrowedOrNull")
- .hide_type("nsCSSValueBorrowedMut")
- .hide_type("nsCSSValueBorrowedMutOrNull")
- .hide_type("nsTimingFunctionBorrowed")
- .hide_type("nsTimingFunctionBorrowedOrNull")
- .hide_type("nsTimingFunctionBorrowedMut")
- .hide_type("nsTimingFunctionBorrowedMutOrNull")
- .hide_type("RawGeckoAnimationPropertySegmentBorrowed")
- .hide_type("RawGeckoAnimationPropertySegmentBorrowedOrNull")
- .hide_type("RawGeckoAnimationPropertySegmentBorrowedMut")
- .hide_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull")
- .hide_type("RawGeckoAnimationValueListBorrowed")
- .hide_type("RawGeckoAnimationValueListBorrowedOrNull")
- .hide_type("RawGeckoAnimationValueListBorrowedMut")
- .hide_type("RawGeckoAnimationValueListBorrowedMutOrNull")
- .hide_type("RawGeckoComputedTimingBorrowed")
- .hide_type("RawGeckoComputedTimingBorrowedOrNull")
- .hide_type("RawGeckoComputedTimingBorrowedMut")
- .hide_type("RawGeckoComputedTimingBorrowedMutOrNull")
- .hide_type("RawGeckoKeyframeListBorrowed")
- .hide_type("RawGeckoKeyframeListBorrowedOrNull")
- .hide_type("RawGeckoKeyframeListBorrowedMut")
- .hide_type("RawGeckoKeyframeListBorrowedMutOrNull")
- .hide_type("RawGeckoComputedKeyframeValuesListBorrowed")
- .hide_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull")
- .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMut")
- .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull")
- .hide_type("RawGeckoFontFaceRuleListBorrowed")
- .hide_type("RawGeckoFontFaceRuleListBorrowedOrNull")
- .hide_type("RawGeckoFontFaceRuleListBorrowedMut")
- .hide_type("RawGeckoFontFaceRuleListBorrowedMutOrNull")
- .raw_line(r#"pub use nsstring::{nsACString, nsAString, nsString};"#)
- .raw_line(r#"type nsACString_internal = nsACString;"#)
- .raw_line(r#"type nsAString_internal = nsAString;"#)
- .raw_line(r#"use gecko_bindings::structs::mozilla::css::URLValue;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationPropertySegment;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedTiming;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoDocument;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoElement;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoKeyframeList;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoFontFaceRuleList;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoNode;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationValueList;"#)
- .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValue;"#)
- .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValueMap;"#)
- .raw_line(r#"use gecko_bindings::structs::RawServoDeclarationBlock;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContext;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContextOwned;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoStyleAnimationList;"#)
- .raw_line(r#"use gecko_bindings::structs::RawGeckoURLExtraData;"#)
- .raw_line(r#"use gecko_bindings::structs::RefPtr;"#)
- .raw_line(r#"use gecko_bindings::structs::CSSPseudoClassType;"#)
- .raw_line(r#"use gecko_bindings::structs::TraversalRootBehavior;"#)
- .raw_line(r#"use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag;"#)
- .raw_line(r#"use gecko_bindings::structs::FontFamilyList;"#)
- .raw_line(r#"use gecko_bindings::structs::FontFamilyType;"#)
- .raw_line(r#"use gecko_bindings::structs::Keyframe;"#)
- .raw_line(r#"use gecko_bindings::structs::ServoBundledURI;"#)
- .raw_line(r#"use gecko_bindings::structs::ServoElementSnapshot;"#)
- .raw_line(r#"use gecko_bindings::structs::SheetParsingMode;"#)
- .raw_line(r#"use gecko_bindings::structs::StyleBasicShape;"#)
- .raw_line(r#"use gecko_bindings::structs::StyleBasicShapeType;"#)
- .raw_line(r#"use gecko_bindings::structs::StyleShapeSource;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSFontFaceRule;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSKeyword;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSPropertyID;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSShadowArray;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSUnit;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSValue;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCSSValueSharedList;"#)
- .raw_line(r#"use gecko_bindings::structs::nsChangeHint;"#)
- .raw_line(r#"use gecko_bindings::structs::nsCursorImage;"#)
- .raw_line(r#"use gecko_bindings::structs::nsFont;"#)
- .raw_line(r#"use gecko_bindings::structs::nsIAtom;"#)
- .raw_line(r#"use gecko_bindings::structs::nsMediaFeature;"#)
- .raw_line(r#"use gecko_bindings::structs::nsRestyleHint;"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleBackground;"#)
- .raw_line(r#"unsafe impl Send for nsStyleBackground {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleBackground {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleBorder;"#)
- .raw_line(r#"unsafe impl Send for nsStyleBorder {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleBorder {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleColor;"#)
- .raw_line(r#"unsafe impl Send for nsStyleColor {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleColor {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleColumn;"#)
- .raw_line(r#"unsafe impl Send for nsStyleColumn {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleColumn {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleContent;"#)
- .raw_line(r#"unsafe impl Send for nsStyleContent {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleContent {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleContentData;"#)
- .raw_line(r#"unsafe impl Send for nsStyleContentData {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleContentData {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleContentType;"#)
- .raw_line(r#"unsafe impl Send for nsStyleContentType {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleContentType {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleContext;"#)
- .raw_line(r#"unsafe impl Send for nsStyleContext {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleContext {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleCoord;"#)
- .raw_line(r#"unsafe impl Send for nsStyleCoord {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleCoord {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_Calc;"#)
- .raw_line(r#"unsafe impl Send for nsStyleCoord_Calc {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleCoord_Calc {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_CalcValue;"#)
- .raw_line(r#"unsafe impl Send for nsStyleCoord_CalcValue {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleCoord_CalcValue {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleDisplay;"#)
- .raw_line(r#"unsafe impl Send for nsStyleDisplay {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleDisplay {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleEffects;"#)
- .raw_line(r#"unsafe impl Send for nsStyleEffects {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleEffects {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleFilter;"#)
- .raw_line(r#"unsafe impl Send for nsStyleFilter {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleFilter {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleFont;"#)
- .raw_line(r#"unsafe impl Send for nsStyleFont {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleFont {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleGradient;"#)
- .raw_line(r#"unsafe impl Send for nsStyleGradient {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleGradient {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleGradientStop;"#)
- .raw_line(r#"unsafe impl Send for nsStyleGradientStop {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleGradientStop {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleImage;"#)
- .raw_line(r#"unsafe impl Send for nsStyleImage {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleImage {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers;"#)
- .raw_line(r#"unsafe impl Send for nsStyleImageLayers {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleImageLayers {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_Layer;"#)
- .raw_line(r#"unsafe impl Send for nsStyleImageLayers_Layer {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_Layer {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_LayerType;"#)
- .raw_line(r#"unsafe impl Send for nsStyleImageLayers_LayerType {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_LayerType {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleImageRequest;"#)
- .raw_line(r#"unsafe impl Send for nsStyleImageRequest {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleImageRequest {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleList;"#)
- .raw_line(r#"unsafe impl Send for nsStyleList {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleList {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleMargin;"#)
- .raw_line(r#"unsafe impl Send for nsStyleMargin {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleMargin {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleOutline;"#)
- .raw_line(r#"unsafe impl Send for nsStyleOutline {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleOutline {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStylePadding;"#)
- .raw_line(r#"unsafe impl Send for nsStylePadding {}"#)
- .raw_line(r#"unsafe impl Sync for nsStylePadding {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStylePosition;"#)
- .raw_line(r#"unsafe impl Send for nsStylePosition {}"#)
- .raw_line(r#"unsafe impl Sync for nsStylePosition {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleQuoteValues;"#)
- .raw_line(r#"unsafe impl Send for nsStyleQuoteValues {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleQuoteValues {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleSVG;"#)
- .raw_line(r#"unsafe impl Send for nsStyleSVG {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleSVG {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleSVGPaint;"#)
- .raw_line(r#"unsafe impl Send for nsStyleSVGPaint {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleSVGPaint {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleSVGReset;"#)
- .raw_line(r#"unsafe impl Send for nsStyleSVGReset {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleSVGReset {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleTable;"#)
- .raw_line(r#"unsafe impl Send for nsStyleTable {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleTable {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleTableBorder;"#)
- .raw_line(r#"unsafe impl Send for nsStyleTableBorder {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleTableBorder {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleText;"#)
- .raw_line(r#"unsafe impl Send for nsStyleText {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleText {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleTextReset;"#)
- .raw_line(r#"unsafe impl Send for nsStyleTextReset {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleTextReset {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleUIReset;"#)
- .raw_line(r#"unsafe impl Send for nsStyleUIReset {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleUIReset {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleUnion;"#)
- .raw_line(r#"unsafe impl Send for nsStyleUnion {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleUnion {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleUnit;"#)
- .raw_line(r#"unsafe impl Send for nsStyleUnit {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleUnit {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleUserInterface;"#)
- .raw_line(r#"unsafe impl Send for nsStyleUserInterface {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleUserInterface {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleVariables;"#)
- .raw_line(r#"unsafe impl Send for nsStyleVariables {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleVariables {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleVisibility;"#)
- .raw_line(r#"unsafe impl Send for nsStyleVisibility {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleVisibility {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsStyleXUL;"#)
- .raw_line(r#"unsafe impl Send for nsStyleXUL {}"#)
- .raw_line(r#"unsafe impl Sync for nsStyleXUL {}"#)
- .raw_line(r#"use gecko_bindings::structs::nsTimingFunction;"#)
- .raw_line(r#"use gecko_bindings::structs::nscolor;"#)
- .raw_line(r#"use gecko_bindings::structs::nscoord;"#)
- .raw_line(r#"use gecko_bindings::structs::nsresult;"#)
- .raw_line(r#"use gecko_bindings::structs::Loader;"#)
- .raw_line(r#"use gecko_bindings::structs::ServoStyleSheet;"#)
- .raw_line(r#"use gecko_bindings::structs::EffectCompositor_CascadeLevel;"#)
- .raw_line(r#"use gecko_bindings::structs::UpdateAnimationsTasks;"#)
- .raw_line(r#"pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;"#)
- .raw_line(r#"pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;"#)
- .raw_line(r#"pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;"#)
- .raw_line(r#"pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;"#)
- .raw_line(r#"enum ServoCssRulesVoid { }"#)
- .raw_line(r#"pub struct ServoCssRules(ServoCssRulesVoid);"#)
- .raw_line(r#"pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheet>;"#)
- .raw_line(r#"pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;"#)
- .raw_line(r#"pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;"#)
- .raw_line(r#"enum RawServoStyleSheetVoid { }"#)
- .raw_line(r#"pub struct RawServoStyleSheet(RawServoStyleSheetVoid);"#)
- .raw_line(r#"pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>;"#)
- .raw_line(r#"pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;"#)
- .raw_line(r#"pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;"#)
- .raw_line(r#"enum ServoComputedValuesVoid { }"#)
- .raw_line(r#"pub struct ServoComputedValues(ServoComputedValuesVoid);"#)
- .raw_line(r#"pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;"#)
- .raw_line(r#"pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;"#)
- .raw_line(r#"pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;"#)
- .raw_line(r#"pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleRule>;"#)
- .raw_line(r#"pub type RawServoStyleRuleBorrowed<'a> = &'a RawServoStyleRule;"#)
- .raw_line(r#"pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;"#)
- .raw_line(r#"enum RawServoStyleRuleVoid { }"#)
- .raw_line(r#"pub struct RawServoStyleRule(RawServoStyleRuleVoid);"#)
- .raw_line(r#"pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoImportRule>;"#)
- .raw_line(r#"pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;"#)
- .raw_line(r#"pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;"#)
- .raw_line(r#"enum RawServoImportRuleVoid { }"#)
- .raw_line(r#"pub struct RawServoImportRule(RawServoImportRuleVoid);"#)
- .raw_line(r#"pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>;"#)
- .raw_line(r#"pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;"#)
- .raw_line(r#"pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;"#)
- .raw_line(r#"pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValueMap>;"#)
- .raw_line(r#"pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;"#)
- .raw_line(r#"pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;"#)
- .raw_line(r#"pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaList>;"#)
- .raw_line(r#"pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;"#)
- .raw_line(r#"pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;"#)
- .raw_line(r#"enum RawServoMediaListVoid { }"#)
- .raw_line(r#"pub struct RawServoMediaList(RawServoMediaListVoid);"#)
- .raw_line(r#"pub type RawServoMediaRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaRule>;"#)
- .raw_line(r#"pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;"#)
- .raw_line(r#"pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;"#)
- .raw_line(r#"enum RawServoMediaRuleVoid { }"#)
- .raw_line(r#"pub struct RawServoMediaRule(RawServoMediaRuleVoid);"#)
- .raw_line(r#"pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;"#)
- .raw_line(r#"pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;"#)
- .raw_line(r#"pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;"#)
- .raw_line(r#"enum RawServoNamespaceRuleVoid { }"#)
- .raw_line(r#"pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);"#)
- .raw_line(r#"pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;"#)
- .raw_line(r#"pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;"#)
- .raw_line(r#"pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;"#)
- .raw_line(r#"pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>;"#)
- .raw_line(r#"pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;"#)
- .raw_line(r#"pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;"#)
- .raw_line(r#"enum RawServoStyleSetVoid { }"#)
- .raw_line(r#"pub struct RawServoStyleSet(RawServoStyleSetVoid);"#)
- .raw_line(r#"pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned<StyleChildrenIterator>;"#)
- .raw_line(r#"pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<StyleChildrenIterator>;"#)
- .raw_line(r#"pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator;"#)
- .raw_line(r#"pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>;"#)
- .raw_line(r#"pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator;"#)
- .raw_line(r#"pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>;"#)
- .raw_line(r#"enum StyleChildrenIteratorVoid { }"#)
- .raw_line(r#"pub struct StyleChildrenIterator(StyleChildrenIteratorVoid);"#)
- .raw_line(r#"pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned<ServoElementSnapshot>;"#)
- .raw_line(r#"pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;"#)
- .raw_line(r#"pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;"#)
- .raw_line(r#"pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;"#)
- .raw_line(r#"pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot;"#)
- .raw_line(r#"pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;"#)
- .raw_line(r#"pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;"#)
- .raw_line(r#"pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;"#)
- .raw_line(r#"pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;"#)
- .raw_line(r#"pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;"#)
- .raw_line(r#"pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;"#)
- .raw_line(r#"pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;"#)
- .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;"#)
- .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;"#)
- .raw_line(r#"pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;"#)
- .raw_line(r#"pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;"#)
- .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;"#)
- .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;"#)
- .raw_line(r#"pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;"#)
- .raw_line(r#"pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;"#)
- .raw_line(r#"pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;"#)
- .raw_line(r#"pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>;"#)
- .raw_line(r#"pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction;"#)
- .raw_line(r#"pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>;"#)
- .raw_line(r#"pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction;"#)
- .raw_line(r#"pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>;"#)
- .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment;"#)
- .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>;"#)
- .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment;"#)
- .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>;"#)
- .raw_line(r#"pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList;"#)
- .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;"#)
- .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;"#)
- .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;"#)
- .raw_line(r#"pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming;"#)
- .raw_line(r#"pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>;"#)
- .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming;"#)
- .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>;"#)
- .raw_line(r#"pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList;"#)
- .raw_line(r#"pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>;"#)
- .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList;"#)
- .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>;"#)
- .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList;"#)
- .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>;"#)
- .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList;"#)
- .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>;"#)
- .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;"#)
- .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;"#)
- .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;"#)
- .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>;"#)
- .clang_arg("-x")
- .clang_arg("c++")
- .clang_arg("-std=c++14")
- .clang_arg("-DTRACING=1")
- .clang_arg("-DIMPL_LIBXUL")
- .clang_arg("-DMOZ_STYLO_BINDINGS=1")
- .clang_arg("-DMOZILLA_INTERNAL_API")
- .clang_arg("-DRUST_BINDGEN")
- .clang_arg("-DMOZ_STYLO")
- .clang_arg("-DOS_POSIX=1")
- .clang_arg("-DOS_LINUX=1")
- .generate()
+ bindgen::builder()
+ .time_phases(true)
+ .header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/stylo.hpp"))
+ .whitelisted_function("Servo_.*")
+ .whitelisted_function("Gecko_.*")
+ .hide_type("nsACString_internal")
+ .hide_type("nsAString_internal")
+ .hide_type("mozilla::css::URLValue")
+ .hide_type("RawGeckoAnimationPropertySegment")
+ .hide_type("RawGeckoComputedTiming")
+ .hide_type("RawGeckoDocument")
+ .hide_type("RawGeckoElement")
+ .hide_type("RawGeckoKeyframeList")
+ .hide_type("RawGeckoComputedKeyframeValuesList")
+ .hide_type("RawGeckoFontFaceRuleList")
+ .hide_type("RawGeckoNode")
+ .hide_type("RawGeckoAnimationValueList")
+ .hide_type("RawServoAnimationValue")
+ .hide_type("RawServoAnimationValueMap")
+ .hide_type("RawServoDeclarationBlock")
+ .hide_type("RawGeckoPresContext")
+ .hide_type("RawGeckoPresContextOwned")
+ .hide_type("RawGeckoStyleAnimationList")
+ .hide_type("RawGeckoURLExtraData")
+ .hide_type("RefPtr")
+ .hide_type("CSSPseudoClassType")
+ .hide_type("TraversalRootBehavior")
+ .hide_type("ComputedTimingFunction_BeforeFlag")
+ .hide_type("FontFamilyList")
+ .hide_type("FontFamilyType")
+ .hide_type("Keyframe")
+ .hide_type("ServoBundledURI")
+ .hide_type("ServoElementSnapshot")
+ .hide_type("SheetParsingMode")
+ .hide_type("StyleBasicShape")
+ .hide_type("StyleBasicShapeType")
+ .hide_type("StyleShapeSource")
+ .hide_type("nsCSSFontFaceRule")
+ .hide_type("nsCSSKeyword")
+ .hide_type("nsCSSPropertyID")
+ .hide_type("nsCSSShadowArray")
+ .hide_type("nsCSSUnit")
+ .hide_type("nsCSSValue")
+ .hide_type("nsCSSValueSharedList")
+ .hide_type("nsChangeHint")
+ .hide_type("nsCursorImage")
+ .hide_type("nsFont")
+ .hide_type("nsIAtom")
+ .hide_type("nsMediaFeature")
+ .hide_type("nsRestyleHint")
+ .hide_type("nsStyleBackground")
+ .hide_type("nsStyleBorder")
+ .hide_type("nsStyleColor")
+ .hide_type("nsStyleColumn")
+ .hide_type("nsStyleContent")
+ .hide_type("nsStyleContentData")
+ .hide_type("nsStyleContentType")
+ .hide_type("nsStyleContext")
+ .hide_type("nsStyleCoord")
+ .hide_type("nsStyleCoord_Calc")
+ .hide_type("nsStyleCoord_CalcValue")
+ .hide_type("nsStyleDisplay")
+ .hide_type("nsStyleEffects")
+ .hide_type("nsStyleFilter")
+ .hide_type("nsStyleFont")
+ .hide_type("nsStyleGradient")
+ .hide_type("nsStyleGradientStop")
+ .hide_type("nsStyleImage")
+ .hide_type("nsStyleImageLayers")
+ .hide_type("nsStyleImageLayers_Layer")
+ .hide_type("nsStyleImageLayers_LayerType")
+ .hide_type("nsStyleImageRequest")
+ .hide_type("nsStyleList")
+ .hide_type("nsStyleMargin")
+ .hide_type("nsStyleOutline")
+ .hide_type("nsStylePadding")
+ .hide_type("nsStylePosition")
+ .hide_type("nsStyleQuoteValues")
+ .hide_type("nsStyleSVG")
+ .hide_type("nsStyleSVGPaint")
+ .hide_type("nsStyleSVGReset")
+ .hide_type("nsStyleTable")
+ .hide_type("nsStyleTableBorder")
+ .hide_type("nsStyleText")
+ .hide_type("nsStyleTextReset")
+ .hide_type("nsStyleUIReset")
+ .hide_type("nsStyleUnion")
+ .hide_type("nsStyleUnit")
+ .hide_type("nsStyleUserInterface")
+ .hide_type("nsStyleVariables")
+ .hide_type("nsStyleVisibility")
+ .hide_type("nsStyleXUL")
+ .hide_type("nsTimingFunction")
+ .hide_type("nscolor")
+ .hide_type("nscoord")
+ .hide_type("nsresult")
+ .hide_type("Loader")
+ .hide_type("ServoStyleSheet")
+ .hide_type("EffectCompositor_CascadeLevel")
+ .hide_type("UpdateAnimationsTasks")
+ .hide_type("nsTArrayBorrowed_uintptr_t")
+ .hide_type("ServoCssRulesStrong")
+ .hide_type("ServoCssRulesBorrowed")
+ .hide_type("ServoCssRulesBorrowedOrNull")
+ .hide_type("ServoCssRules")
+ .hide_type("RawServoStyleSheetStrong")
+ .hide_type("RawServoStyleSheetBorrowed")
+ .hide_type("RawServoStyleSheetBorrowedOrNull")
+ .hide_type("RawServoStyleSheet")
+ .hide_type("ServoComputedValuesStrong")
+ .hide_type("ServoComputedValuesBorrowed")
+ .hide_type("ServoComputedValuesBorrowedOrNull")
+ .hide_type("ServoComputedValues")
+ .hide_type("RawServoDeclarationBlockStrong")
+ .hide_type("RawServoDeclarationBlockBorrowed")
+ .hide_type("RawServoDeclarationBlockBorrowedOrNull")
+ .hide_type("RawServoStyleRuleStrong")
+ .hide_type("RawServoStyleRuleBorrowed")
+ .hide_type("RawServoStyleRuleBorrowedOrNull")
+ .hide_type("RawServoStyleRule")
+ .hide_type("RawServoImportRuleStrong")
+ .hide_type("RawServoImportRuleBorrowed")
+ .hide_type("RawServoImportRuleBorrowedOrNull")
+ .hide_type("RawServoImportRule")
+ .hide_type("RawServoAnimationValueStrong")
+ .hide_type("RawServoAnimationValueBorrowed")
+ .hide_type("RawServoAnimationValueBorrowedOrNull")
+ .hide_type("RawServoAnimationValueMapStrong")
+ .hide_type("RawServoAnimationValueMapBorrowed")
+ .hide_type("RawServoAnimationValueMapBorrowedOrNull")
+ .hide_type("RawServoMediaListStrong")
+ .hide_type("RawServoMediaListBorrowed")
+ .hide_type("RawServoMediaListBorrowedOrNull")
+ .hide_type("RawServoMediaList")
+ .hide_type("RawServoMediaRuleStrong")
+ .hide_type("RawServoMediaRuleBorrowed")
+ .hide_type("RawServoMediaRuleBorrowedOrNull")
+ .hide_type("RawServoMediaRule")
+ .hide_type("RawServoNamespaceRuleStrong")
+ .hide_type("RawServoNamespaceRuleBorrowed")
+ .hide_type("RawServoNamespaceRuleBorrowedOrNull")
+ .hide_type("RawServoNamespaceRule")
+ .hide_type("RawServoStyleSetOwned")
+ .hide_type("RawServoStyleSetOwnedOrNull")
+ .hide_type("RawServoStyleSetBorrowed")
+ .hide_type("RawServoStyleSetBorrowedOrNull")
+ .hide_type("RawServoStyleSetBorrowedMut")
+ .hide_type("RawServoStyleSetBorrowedMutOrNull")
+ .hide_type("RawServoStyleSet")
+ .hide_type("StyleChildrenIteratorOwned")
+ .hide_type("StyleChildrenIteratorOwnedOrNull")
+ .hide_type("StyleChildrenIteratorBorrowed")
+ .hide_type("StyleChildrenIteratorBorrowedOrNull")
+ .hide_type("StyleChildrenIteratorBorrowedMut")
+ .hide_type("StyleChildrenIteratorBorrowedMutOrNull")
+ .hide_type("StyleChildrenIterator")
+ .hide_type("ServoElementSnapshotOwned")
+ .hide_type("ServoElementSnapshotOwnedOrNull")
+ .hide_type("ServoElementSnapshotBorrowed")
+ .hide_type("ServoElementSnapshotBorrowedOrNull")
+ .hide_type("ServoElementSnapshotBorrowedMut")
+ .hide_type("ServoElementSnapshotBorrowedMutOrNull")
+ .hide_type("RawGeckoNodeBorrowed")
+ .hide_type("RawGeckoNodeBorrowedOrNull")
+ .hide_type("RawGeckoElementBorrowed")
+ .hide_type("RawGeckoElementBorrowedOrNull")
+ .hide_type("RawGeckoDocumentBorrowed")
+ .hide_type("RawGeckoDocumentBorrowedOrNull")
+ .hide_type("RawServoDeclarationBlockStrongBorrowed")
+ .hide_type("RawServoDeclarationBlockStrongBorrowedOrNull")
+ .hide_type("RawGeckoPresContextBorrowed")
+ .hide_type("RawGeckoPresContextBorrowedOrNull")
+ .hide_type("RawGeckoStyleAnimationListBorrowed")
+ .hide_type("RawGeckoStyleAnimationListBorrowedOrNull")
+ .hide_type("nsCSSValueBorrowed")
+ .hide_type("nsCSSValueBorrowedOrNull")
+ .hide_type("nsCSSValueBorrowedMut")
+ .hide_type("nsCSSValueBorrowedMutOrNull")
+ .hide_type("nsTimingFunctionBorrowed")
+ .hide_type("nsTimingFunctionBorrowedOrNull")
+ .hide_type("nsTimingFunctionBorrowedMut")
+ .hide_type("nsTimingFunctionBorrowedMutOrNull")
+ .hide_type("RawGeckoAnimationPropertySegmentBorrowed")
+ .hide_type("RawGeckoAnimationPropertySegmentBorrowedOrNull")
+ .hide_type("RawGeckoAnimationPropertySegmentBorrowedMut")
+ .hide_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull")
+ .hide_type("RawGeckoAnimationValueListBorrowed")
+ .hide_type("RawGeckoAnimationValueListBorrowedOrNull")
+ .hide_type("RawGeckoAnimationValueListBorrowedMut")
+ .hide_type("RawGeckoAnimationValueListBorrowedMutOrNull")
+ .hide_type("RawGeckoComputedTimingBorrowed")
+ .hide_type("RawGeckoComputedTimingBorrowedOrNull")
+ .hide_type("RawGeckoComputedTimingBorrowedMut")
+ .hide_type("RawGeckoComputedTimingBorrowedMutOrNull")
+ .hide_type("RawGeckoKeyframeListBorrowed")
+ .hide_type("RawGeckoKeyframeListBorrowedOrNull")
+ .hide_type("RawGeckoKeyframeListBorrowedMut")
+ .hide_type("RawGeckoKeyframeListBorrowedMutOrNull")
+ .hide_type("RawGeckoComputedKeyframeValuesListBorrowed")
+ .hide_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull")
+ .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMut")
+ .hide_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull")
+ .hide_type("RawGeckoFontFaceRuleListBorrowed")
+ .hide_type("RawGeckoFontFaceRuleListBorrowedOrNull")
+ .hide_type("RawGeckoFontFaceRuleListBorrowedMut")
+ .hide_type("RawGeckoFontFaceRuleListBorrowedMutOrNull")
+ .raw_line(r#"pub use nsstring::{nsACString, nsAString, nsString};"#)
+ .raw_line(r#"type nsACString_internal = nsACString;"#)
+ .raw_line(r#"type nsAString_internal = nsAString;"#)
+ .raw_line(r#"use gecko_bindings::structs::mozilla::css::URLValue;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationPropertySegment;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedTiming;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoDocument;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoElement;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoKeyframeList;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoFontFaceRuleList;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoNode;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoAnimationValueList;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValue;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawServoAnimationValueMap;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawServoDeclarationBlock;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContext;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoPresContextOwned;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoStyleAnimationList;"#)
+ .raw_line(r#"use gecko_bindings::structs::RawGeckoURLExtraData;"#)
+ .raw_line(r#"use gecko_bindings::structs::RefPtr;"#)
+ .raw_line(r#"use gecko_bindings::structs::CSSPseudoClassType;"#)
+ .raw_line(r#"use gecko_bindings::structs::TraversalRootBehavior;"#)
+ .raw_line(r#"use gecko_bindings::structs::ComputedTimingFunction_BeforeFlag;"#)
+ .raw_line(r#"use gecko_bindings::structs::FontFamilyList;"#)
+ .raw_line(r#"use gecko_bindings::structs::FontFamilyType;"#)
+ .raw_line(r#"use gecko_bindings::structs::Keyframe;"#)
+ .raw_line(r#"use gecko_bindings::structs::ServoBundledURI;"#)
+ .raw_line(r#"use gecko_bindings::structs::ServoElementSnapshot;"#)
+ .raw_line(r#"use gecko_bindings::structs::SheetParsingMode;"#)
+ .raw_line(r#"use gecko_bindings::structs::StyleBasicShape;"#)
+ .raw_line(r#"use gecko_bindings::structs::StyleBasicShapeType;"#)
+ .raw_line(r#"use gecko_bindings::structs::StyleShapeSource;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSFontFaceRule;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSKeyword;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSPropertyID;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSShadowArray;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSUnit;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSValue;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCSSValueSharedList;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsChangeHint;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsCursorImage;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsFont;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsIAtom;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsMediaFeature;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsRestyleHint;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleBackground;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleBackground {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleBackground {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleBorder;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleBorder {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleBorder {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleColor;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleColor {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleColor {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleColumn;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleColumn {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleColumn {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleContent;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleContent {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleContent {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleContentData;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleContentData {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleContentData {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleContentType;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleContentType {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleContentType {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleContext;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleContext {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleContext {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleCoord;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleCoord {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleCoord {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_Calc;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleCoord_Calc {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleCoord_Calc {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleCoord_CalcValue;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleCoord_CalcValue {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleCoord_CalcValue {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleDisplay;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleDisplay {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleDisplay {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleEffects;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleEffects {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleEffects {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleFilter;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleFilter {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleFilter {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleFont;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleFont {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleFont {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleGradient;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleGradient {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleGradient {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleGradientStop;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleGradientStop {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleGradientStop {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleImage;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleImage {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleImage {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleImageLayers {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleImageLayers {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_Layer;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleImageLayers_Layer {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_Layer {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleImageLayers_LayerType;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleImageLayers_LayerType {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleImageLayers_LayerType {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleImageRequest;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleImageRequest {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleImageRequest {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleList;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleList {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleList {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleMargin;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleMargin {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleMargin {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleOutline;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleOutline {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleOutline {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStylePadding;"#)
+ .raw_line(r#"unsafe impl Send for nsStylePadding {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStylePadding {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStylePosition;"#)
+ .raw_line(r#"unsafe impl Send for nsStylePosition {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStylePosition {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleQuoteValues;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleQuoteValues {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleQuoteValues {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleSVG;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleSVG {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleSVG {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleSVGPaint;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleSVGPaint {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleSVGPaint {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleSVGReset;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleSVGReset {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleSVGReset {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleTable;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleTable {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleTable {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleTableBorder;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleTableBorder {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleTableBorder {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleText;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleText {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleText {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleTextReset;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleTextReset {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleTextReset {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleUIReset;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleUIReset {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleUIReset {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleUnion;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleUnion {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleUnion {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleUnit;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleUnit {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleUnit {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleUserInterface;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleUserInterface {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleUserInterface {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleVariables;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleVariables {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleVariables {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleVisibility;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleVisibility {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleVisibility {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsStyleXUL;"#)
+ .raw_line(r#"unsafe impl Send for nsStyleXUL {}"#)
+ .raw_line(r#"unsafe impl Sync for nsStyleXUL {}"#)
+ .raw_line(r#"use gecko_bindings::structs::nsTimingFunction;"#)
+ .raw_line(r#"use gecko_bindings::structs::nscolor;"#)
+ .raw_line(r#"use gecko_bindings::structs::nscoord;"#)
+ .raw_line(r#"use gecko_bindings::structs::nsresult;"#)
+ .raw_line(r#"use gecko_bindings::structs::Loader;"#)
+ .raw_line(r#"use gecko_bindings::structs::ServoStyleSheet;"#)
+ .raw_line(r#"use gecko_bindings::structs::EffectCompositor_CascadeLevel;"#)
+ .raw_line(r#"use gecko_bindings::structs::UpdateAnimationsTasks;"#)
+ .raw_line(r#"pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;"#)
+ .raw_line(r#"pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;"#)
+ .raw_line(r#"pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;"#)
+ .raw_line(r#"pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;"#)
+ .raw_line(r#"enum ServoCssRulesVoid { }"#)
+ .raw_line(r#"pub struct ServoCssRules(ServoCssRulesVoid);"#)
+ .raw_line(r#"pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheet>;"#)
+ .raw_line(r#"pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;"#)
+ .raw_line(r#"pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;"#)
+ .raw_line(r#"enum RawServoStyleSheetVoid { }"#)
+ .raw_line(r#"pub struct RawServoStyleSheet(RawServoStyleSheetVoid);"#)
+ .raw_line(r#"pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>;"#)
+ .raw_line(r#"pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;"#)
+ .raw_line(r#"pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;"#)
+ .raw_line(r#"enum ServoComputedValuesVoid { }"#)
+ .raw_line(r#"pub struct ServoComputedValues(ServoComputedValuesVoid);"#)
+ .raw_line(r#"pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;"#)
+ .raw_line(r#"pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;"#)
+ .raw_line(r#"pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;"#)
+ .raw_line(r#"pub type RawServoStyleRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleRule>;"#)
+ .raw_line(r#"pub type RawServoStyleRuleBorrowed<'a> = &'a RawServoStyleRule;"#)
+ .raw_line(r#"pub type RawServoStyleRuleBorrowedOrNull<'a> = Option<&'a RawServoStyleRule>;"#)
+ .raw_line(r#"enum RawServoStyleRuleVoid { }"#)
+ .raw_line(r#"pub struct RawServoStyleRule(RawServoStyleRuleVoid);"#)
+ .raw_line(r#"pub type RawServoImportRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoImportRule>;"#)
+ .raw_line(r#"pub type RawServoImportRuleBorrowed<'a> = &'a RawServoImportRule;"#)
+ .raw_line(r#"pub type RawServoImportRuleBorrowedOrNull<'a> = Option<&'a RawServoImportRule>;"#)
+ .raw_line(r#"enum RawServoImportRuleVoid { }"#)
+ .raw_line(r#"pub struct RawServoImportRule(RawServoImportRuleVoid);"#)
+ .raw_line(r#"pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>;"#)
+ .raw_line(r#"pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;"#)
+ .raw_line(r#"pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;"#)
+ .raw_line(r#"pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValueMap>;"#)
+ .raw_line(r#"pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;"#)
+ .raw_line(r#"pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;"#)
+ .raw_line(r#"pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaList>;"#)
+ .raw_line(r#"pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;"#)
+ .raw_line(r#"pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;"#)
+ .raw_line(r#"enum RawServoMediaListVoid { }"#)
+ .raw_line(r#"pub struct RawServoMediaList(RawServoMediaListVoid);"#)
+ .raw_line(r#"pub type RawServoMediaRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaRule>;"#)
+ .raw_line(r#"pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;"#)
+ .raw_line(r#"pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;"#)
+ .raw_line(r#"enum RawServoMediaRuleVoid { }"#)
+ .raw_line(r#"pub struct RawServoMediaRule(RawServoMediaRuleVoid);"#)
+ .raw_line(r#"pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;"#)
+ .raw_line(r#"pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;"#)
+ .raw_line(r#"pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;"#)
+ .raw_line(r#"enum RawServoNamespaceRuleVoid { }"#)
+ .raw_line(r#"pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);"#)
+ .raw_line(r#"pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;"#)
+ .raw_line(r#"pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;"#)
+ .raw_line(r#"pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;"#)
+ .raw_line(r#"pub type RawServoStyleSetBorrowedOrNull<'a> = Option<&'a RawServoStyleSet>;"#)
+ .raw_line(r#"pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;"#)
+ .raw_line(r#"pub type RawServoStyleSetBorrowedMutOrNull<'a> = Option<&'a mut RawServoStyleSet>;"#)
+ .raw_line(r#"enum RawServoStyleSetVoid { }"#)
+ .raw_line(r#"pub struct RawServoStyleSet(RawServoStyleSetVoid);"#)
+ .raw_line(r#"pub type StyleChildrenIteratorOwned = ::gecko_bindings::sugar::ownership::Owned<StyleChildrenIterator>;"#)
+ .raw_line(r#"pub type StyleChildrenIteratorOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<StyleChildrenIterator>;"#)
+ .raw_line(r#"pub type StyleChildrenIteratorBorrowed<'a> = &'a StyleChildrenIterator;"#)
+ .raw_line(r#"pub type StyleChildrenIteratorBorrowedOrNull<'a> = Option<&'a StyleChildrenIterator>;"#)
+ .raw_line(r#"pub type StyleChildrenIteratorBorrowedMut<'a> = &'a mut StyleChildrenIterator;"#)
+ .raw_line(r#"pub type StyleChildrenIteratorBorrowedMutOrNull<'a> = Option<&'a mut StyleChildrenIterator>;"#)
+ .raw_line(r#"enum StyleChildrenIteratorVoid { }"#)
+ .raw_line(r#"pub struct StyleChildrenIterator(StyleChildrenIteratorVoid);"#)
+ .raw_line(r#"pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned<ServoElementSnapshot>;"#)
+ .raw_line(r#"pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;"#)
+ .raw_line(r#"pub type ServoElementSnapshotBorrowed<'a> = &'a ServoElementSnapshot;"#)
+ .raw_line(r#"pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;"#)
+ .raw_line(r#"pub type ServoElementSnapshotBorrowedMut<'a> = &'a mut ServoElementSnapshot;"#)
+ .raw_line(r#"pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;"#)
+ .raw_line(r#"pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;"#)
+ .raw_line(r#"pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;"#)
+ .raw_line(r#"pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;"#)
+ .raw_line(r#"pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;"#)
+ .raw_line(r#"pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;"#)
+ .raw_line(r#"pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;"#)
+ .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowed<'a> = &'a RawServoDeclarationBlockStrong;"#)
+ .raw_line(r#"pub type RawServoDeclarationBlockStrongBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlockStrong>;"#)
+ .raw_line(r#"pub type RawGeckoPresContextBorrowed<'a> = &'a RawGeckoPresContext;"#)
+ .raw_line(r#"pub type RawGeckoPresContextBorrowedOrNull<'a> = Option<&'a RawGeckoPresContext>;"#)
+ .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowed<'a> = &'a RawGeckoStyleAnimationList;"#)
+ .raw_line(r#"pub type RawGeckoStyleAnimationListBorrowedOrNull<'a> = Option<&'a RawGeckoStyleAnimationList>;"#)
+ .raw_line(r#"pub type nsCSSValueBorrowed<'a> = &'a nsCSSValue;"#)
+ .raw_line(r#"pub type nsCSSValueBorrowedOrNull<'a> = Option<&'a nsCSSValue>;"#)
+ .raw_line(r#"pub type nsCSSValueBorrowedMut<'a> = &'a mut nsCSSValue;"#)
+ .raw_line(r#"pub type nsCSSValueBorrowedMutOrNull<'a> = Option<&'a mut nsCSSValue>;"#)
+ .raw_line(r#"pub type nsTimingFunctionBorrowed<'a> = &'a nsTimingFunction;"#)
+ .raw_line(r#"pub type nsTimingFunctionBorrowedOrNull<'a> = Option<&'a nsTimingFunction>;"#)
+ .raw_line(r#"pub type nsTimingFunctionBorrowedMut<'a> = &'a mut nsTimingFunction;"#)
+ .raw_line(r#"pub type nsTimingFunctionBorrowedMutOrNull<'a> = Option<&'a mut nsTimingFunction>;"#)
+ .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowed<'a> = &'a RawGeckoAnimationPropertySegment;"#)
+ .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationPropertySegment>;"#)
+ .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMut<'a> = &'a mut RawGeckoAnimationPropertySegment;"#)
+ .raw_line(r#"pub type RawGeckoAnimationPropertySegmentBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationPropertySegment>;"#)
+ .raw_line(r#"pub type RawGeckoAnimationValueListBorrowed<'a> = &'a RawGeckoAnimationValueList;"#)
+ .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedOrNull<'a> = Option<&'a RawGeckoAnimationValueList>;"#)
+ .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMut<'a> = &'a mut RawGeckoAnimationValueList;"#)
+ .raw_line(r#"pub type RawGeckoAnimationValueListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoAnimationValueList>;"#)
+ .raw_line(r#"pub type RawGeckoComputedTimingBorrowed<'a> = &'a RawGeckoComputedTiming;"#)
+ .raw_line(r#"pub type RawGeckoComputedTimingBorrowedOrNull<'a> = Option<&'a RawGeckoComputedTiming>;"#)
+ .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMut<'a> = &'a mut RawGeckoComputedTiming;"#)
+ .raw_line(r#"pub type RawGeckoComputedTimingBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedTiming>;"#)
+ .raw_line(r#"pub type RawGeckoKeyframeListBorrowed<'a> = &'a RawGeckoKeyframeList;"#)
+ .raw_line(r#"pub type RawGeckoKeyframeListBorrowedOrNull<'a> = Option<&'a RawGeckoKeyframeList>;"#)
+ .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMut<'a> = &'a mut RawGeckoKeyframeList;"#)
+ .raw_line(r#"pub type RawGeckoKeyframeListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoKeyframeList>;"#)
+ .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowed<'a> = &'a RawGeckoComputedKeyframeValuesList;"#)
+ .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedOrNull<'a> = Option<&'a RawGeckoComputedKeyframeValuesList>;"#)
+ .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMut<'a> = &'a mut RawGeckoComputedKeyframeValuesList;"#)
+ .raw_line(r#"pub type RawGeckoComputedKeyframeValuesListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoComputedKeyframeValuesList>;"#)
+ .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowed<'a> = &'a RawGeckoFontFaceRuleList;"#)
+ .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedOrNull<'a> = Option<&'a RawGeckoFontFaceRuleList>;"#)
+ .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMut<'a> = &'a mut RawGeckoFontFaceRuleList;"#)
+ .raw_line(r#"pub type RawGeckoFontFaceRuleListBorrowedMutOrNull<'a> = Option<&'a mut RawGeckoFontFaceRuleList>;"#)
+ .clang_arg("-x")
+ .clang_arg("c++")
+ .clang_arg("-std=c++14")
+ .clang_arg("-DTRACING=1")
+ .clang_arg("-DIMPL_LIBXUL")
+ .clang_arg("-DMOZ_STYLO_BINDINGS=1")
+ .clang_arg("-DMOZILLA_INTERNAL_API")
+ .clang_arg("-DRUST_BINDGEN")
+ .clang_arg("-DMOZ_STYLO")
+ .clang_arg("-DOS_POSIX=1")
+ .clang_arg("-DOS_LINUX=1")
+ .generate()
.expect("Should generate stylo bindings");
let now = Instant::now();
diff --git a/tests/test-one.sh b/tests/test-one.sh
index 50950a59..91da55b1 100755
--- a/tests/test-one.sh
+++ b/tests/test-one.sh
@@ -45,7 +45,7 @@ TEST_BINDINGS_BINARY=$(mktemp -t bindings.XXXXXX)
FLAGS="$(grep "// bindgen-flags: " "$TEST" || echo)"
FLAGS="${FLAGS/\/\/ bindgen\-flags:/}"
# Prepend the default flags added in test.rs's `create_bindgen_builder`.
-FLAGS="--with-derive-default --raw-line '' --raw-line '#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]' --raw-line '' $FLAGS"
+FLAGS="--rustfmt-bindings --with-derive-default --raw-line '' --raw-line '#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]' --raw-line '' $FLAGS"
eval ./target/debug/bindgen \
@@ -56,6 +56,8 @@ eval ./target/debug/bindgen \
-o "\"$BINDINGS\"" \
$FLAGS
+rustup run nightly rustfmt "$BINDINGS" || true
+
dot -Tpng ir.dot -o ir.png
echo
@@ -78,6 +80,8 @@ EXPECTED=${TEST/headers/expectations\/tests}
EXPECTED=${EXPECTED/.hpp/.rs}
EXPECTED=${EXPECTED/.h/.rs}
+rustup run nightly rustfmt "$EXPECTED" || true
+
# Don't exit early if there is a diff.
diff -U8 "$EXPECTED" "$BINDINGS" || true
diff --git a/tests/tests.rs b/tests/tests.rs
index 01f46ac6..1e02da2d 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -5,42 +5,123 @@ extern crate shlex;
use bindgen::{Builder, builder, clang_version};
use std::fs;
-use std::io::{BufRead, BufReader, Error, ErrorKind, Read, Write};
+use std::io::{self, BufRead, BufReader, Error, ErrorKind, Read, Write};
use std::path::PathBuf;
+use std::process;
+use std::sync::{Once, ONCE_INIT};
#[path = "../src/options.rs"]
mod options;
use options::builder_from_flags;
+// Run `rustfmt` on the given source string and return a tuple of the formatted
+// bindings, and rustfmt's stderr.
+fn rustfmt(source: String) -> (String, String) {
+ static CHECK_RUSTFMT: Once = ONCE_INIT;
+
+ CHECK_RUSTFMT.call_once(|| {
+ let have_working_rustfmt = process::Command::new("rustup")
+ .args(&["run", "nightly", "rustfmt", "--version"])
+ .stdout(process::Stdio::null())
+ .stderr(process::Stdio::null())
+ .status()
+ .ok()
+ .map_or(false, |status| status.success());
+
+ if !have_working_rustfmt {
+ panic!("
+The latest `rustfmt` is required to run the `bindgen` test suite. Install
+`rustfmt` with:
+
+ $ rustup update nightly
+ $ rustup run nightly cargo install -f rustfmt-nightly
+");
+ }
+ });
+
+ let mut child = process::Command::new("rustup")
+ .args(&[
+ "run",
+ "nightly",
+ "rustfmt",
+ "--config-path",
+ concat!(env!("CARGO_MANIFEST_DIR"), "/tests/rustfmt.toml")
+ ])
+ .stdin(process::Stdio::piped())
+ .stdout(process::Stdio::piped())
+ .stderr(process::Stdio::piped())
+ .spawn()
+ .expect("should spawn `rustup run nightly rustfmt`");
+
+ let mut stdin = child.stdin.take().unwrap();
+ let mut stdout = child.stdout.take().unwrap();
+ let mut stderr = child.stderr.take().unwrap();
+
+ // Write to stdin in a new thread, so that we can read from stdout on this
+ // thread. This keeps the child from blocking on writing to its stdout which
+ // might block us from writing to its stdin.
+ let stdin_handle = ::std::thread::spawn(move || {
+ stdin.write_all(source.as_bytes())
+ });
+
+ // Read stderr on a new thread for similar reasons.
+ let stderr_handle = ::std::thread::spawn(move || {
+ let mut output = vec![];
+ io::copy(&mut stderr, &mut output)
+ .map(|_| String::from_utf8_lossy(&output).to_string())
+ });
+
+ let mut output = vec![];
+ io::copy(&mut stdout, &mut output)
+ .expect("Should copy stdout into vec OK");
+
+ // Ignore actual rustfmt status because it is often non-zero for trivial
+ // things.
+ let _ = child.wait().expect("should wait on rustfmt child OK");
+
+ stdin_handle.join()
+ .expect("writer thread should not have panicked")
+ .expect("should have written to child rustfmt's stdin OK");
+
+ let bindings = String::from_utf8(output)
+ .expect("rustfmt should only emit valid utf-8");
+
+ let stderr = stderr_handle.join()
+ .expect("stderr reader thread should not have panicked")
+ .expect("should have read child rustfmt's stderr OK");
+
+ (bindings, stderr)
+}
+
fn compare_generated_header(
header: &PathBuf,
builder: Builder,
) -> Result<(), Error> {
let file_name = try!(header.file_name().ok_or(Error::new(
ErrorKind::Other,
- "spawn_bindgen expects a file",
+ "compare_generated_header expects a file",
)));
- let mut expected = PathBuf::from(header);
- expected.pop();
- expected.pop();
- expected.push("expectations");
- expected.push("tests");
- expected.push(file_name);
- expected.set_extension("rs");
+ let mut expectation = PathBuf::from(header);
+ expectation.pop();
+ expectation.pop();
+ expectation.push("expectations");
+ expectation.push("tests");
+ expectation.push(file_name);
+ expectation.set_extension("rs");
// If the expectation file doesn't exist, see if we have different test
// expectations for different libclang versions.
- if !expected.is_file() {
- let file_name = expected.file_name().unwrap().to_owned();
- expected.pop();
+ if !expectation.is_file() {
+ let file_name = expectation.file_name().unwrap().to_owned();
+ expectation.pop();
if cfg!(feature = "testing_only_libclang_4") {
- expected.push("libclang-4");
+ expectation.push("libclang-4");
} else if cfg!(feature = "testing_only_libclang_3_9") {
- expected.push("libclang-3.9");
+ expectation.push("libclang-3.9");
} else if cfg!(feature = "testing_only_libclang_3_8") {
- expected.push("libclang-3.8");
+ expectation.push("libclang-3.8");
} else {
match clang_version().parsed {
None => {}
@@ -51,38 +132,45 @@ fn compare_generated_header(
} else {
format!("{}.{}", maj, min)
};
- expected.push(format!("libclang-{}", version_str));
+ expectation.push(format!("libclang-{}", version_str));
}
}
}
- expected.push(file_name);
+ expectation.push(file_name);
- if !expected.is_file() {
+ if !expectation.is_file() {
panic!(
"missing test expectation file and/or 'testing_only_libclang_$VERSION' \
feature for header '{}'; looking for expectation file at '{}'",
header.display(),
- expected.display()
+ expectation.display()
);
}
}
// We skip the generate() error here so we get a full diff below
- let output = match builder.generate() {
- Ok(bindings) => bindings.to_string(),
- Err(_) => "".to_string(),
+ let (actual, rustfmt_stderr) = match builder.generate() {
+ Ok(bindings) => {
+ let actual = bindings.to_string();
+ rustfmt(actual)
+ }
+ Err(()) => ("<error generating bindings>".to_string(), "".to_string()),
};
+ println!("{}", rustfmt_stderr);
- let mut buffer = String::new();
+ let mut expected = String::new();
{
- if let Ok(expected_file) = fs::File::open(&expected) {
- try!(BufReader::new(expected_file).read_to_string(&mut buffer));
+ if let Ok(expectation_file) = fs::File::open(&expectation) {
+ try!(BufReader::new(expectation_file).read_to_string(&mut expected));
}
}
- if output == buffer {
- if !output.is_empty() {
+ let (expected, rustfmt_stderr) = rustfmt(expected);
+ println!("{}", rustfmt_stderr);
+
+ if actual == expected {
+ if !actual.is_empty() {
return Ok(());
}
return Err(Error::new(
@@ -91,11 +179,13 @@ fn compare_generated_header(
));
}
+ println!("{}", rustfmt_stderr);
+
println!("diff expected generated");
- println!("--- expected: {:?}", expected);
+ println!("--- expected: {:?}", expectation);
println!("+++ generated from: {:?}", header);
- for diff in diff::lines(&buffer, &output) {
+ for diff in diff::lines(&expected, &actual) {
match diff {
diff::Result::Left(l) => println!("-{}", l),
diff::Result::Both(l, _) => println!(" {}", l),
@@ -105,8 +195,8 @@ fn compare_generated_header(
// Override the diff.
{
- let mut expected_file = try!(fs::File::create(&expected));
- try!(expected_file.write_all(output.as_bytes()));
+ let mut expectation_file = try!(fs::File::create(&expectation));
+ try!(expectation_file.write_all(actual.as_bytes()));
}
Err(Error::new(ErrorKind::Other, "Header and binding differ!"))
@@ -215,19 +305,25 @@ include!(concat!(env!("OUT_DIR"), "/tests.rs"));
#[test]
fn test_header_contents() {
- let bindings = builder()
+ let actual = builder()
.header_contents("test.h", "int foo(const char* a);")
.generate()
.unwrap()
.to_string();
- assert_eq!(
- bindings,
- "/* automatically generated by rust-bindgen */
+
+ let (actual, stderr) = rustfmt(actual);
+ println!("{}", stderr);
+
+ let (expected, _) = rustfmt("/* automatically generated by rust-bindgen */
extern \"C\" {
pub fn foo(a: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
-"
+".to_string());
+
+ assert_eq!(
+ expected,
+ actual
);
}
@@ -243,10 +339,14 @@ fn test_multiple_header_calls_in_builder() {
.unwrap()
.to_string();
+ let (actual, stderr) = rustfmt(actual);
+ println!("{}", stderr);
+
let expected = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/tests/expectations/tests/test_multiple_header_calls_in_builder.rs"
));
+ let (expected, _) = rustfmt(expected.to_string());
if actual != expected {
println!("Generated bindings differ from expected!");