diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-10-11 16:23:25 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-10-14 14:15:46 +0200 |
commit | 94b0af83e6d9bc37021aa0ea84ee164030748dfc (patch) | |
tree | addee573c74a4163fba95567a9099f493c105a28 /tests | |
parent | 4f3452f6f6908424c93dc3b7466d96e458697818 (diff) |
tests: Reformat test crate.
Now that the rustfmt configuration is different we need to do this to not
generate unexpected failures.
Diffstat (limited to 'tests')
386 files changed, 5490 insertions, 2180 deletions
diff --git a/tests/expectations/build.rs b/tests/expectations/build.rs index 4e83fc26..46526458 100644 --- a/tests/expectations/build.rs +++ b/tests/expectations/build.rs @@ -8,8 +8,13 @@ use std::fs; use std::io::Write; use std::path::Path; -const LIBCLANG_VERSION_DIRS: &'static [&'static str] = - &["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5", "libclang-9"]; +const LIBCLANG_VERSION_DIRS: &'static [&'static str] = &[ + "libclang-3.8", + "libclang-3.9", + "libclang-4", + "libclang-5", + "libclang-9", +]; fn main() { println!("cargo:rerun-if-changed=build.rs"); @@ -27,13 +32,16 @@ fn main() { let entry = entry.unwrap(); let path = entry.path(); let path = path.canonicalize().unwrap_or_else(|_| path.into()); - if path.extension().map(|e| e.to_string_lossy()) != Some("rs".into()) { + if path.extension().map(|e| e.to_string_lossy()) != + Some("rs".into()) + { continue; } println!("cargo:rerun-if-changed={}", path.display()); - let module_name: String = path.display() + let module_name: String = path + .display() .to_string() .chars() .map(|c| match c { diff --git a/tests/expectations/src/lib.rs b/tests/expectations/src/lib.rs index e69de29b..8b137891 100644 --- a/tests/expectations/src/lib.rs +++ b/tests/expectations/src/lib.rs @@ -0,0 +1 @@ + diff --git a/tests/expectations/tests/16-byte-alignment.rs b/tests/expectations/tests/16-byte-alignment.rs index 3a9e8998..19151c7d 100644 --- a/tests/expectations/tests/16-byte-alignment.rs +++ b/tests/expectations/tests/16-byte-alignment.rs @@ -47,8 +47,9 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>())).dport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .dport as *const _ as usize }, 0usize, concat!( @@ -60,8 +61,9 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>())).sport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .sport as *const _ as usize }, 2usize, concat!( @@ -86,7 +88,8 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1>())).sctp_tag as *const _ as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1>())).sctp_tag + as *const _ as usize }, 0usize, concat!( @@ -115,7 +118,10 @@ fn bindgen_test_layout_rte_ipv4_tuple() { concat!("Alignment of ", stringify!(rte_ipv4_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv4_tuple>())).src_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv4_tuple>())).src_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -125,7 +131,10 @@ fn bindgen_test_layout_rte_ipv4_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv4_tuple>())).dst_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv4_tuple>())).dst_addr as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -180,8 +189,9 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>())).dport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .dport as *const _ as usize }, 0usize, concat!( @@ -193,8 +203,9 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>())).sport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .sport as *const _ as usize }, 2usize, concat!( @@ -219,7 +230,8 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1>())).sctp_tag as *const _ as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1>())).sctp_tag + as *const _ as usize }, 0usize, concat!( @@ -248,7 +260,10 @@ fn bindgen_test_layout_rte_ipv6_tuple() { concat!("Alignment of ", stringify!(rte_ipv6_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv6_tuple>())).src_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv6_tuple>())).src_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -258,7 +273,10 @@ fn bindgen_test_layout_rte_ipv6_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv6_tuple>())).dst_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv6_tuple>())).dst_addr as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -294,7 +312,9 @@ fn bindgen_test_layout_rte_thash_tuple() { concat!("Alignment of ", stringify!(rte_thash_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_thash_tuple>())).v4 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_thash_tuple>())).v4 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -304,7 +324,9 @@ fn bindgen_test_layout_rte_thash_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_thash_tuple>())).v6 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_thash_tuple>())).v6 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/16-byte-alignment_1_0.rs b/tests/expectations/tests/16-byte-alignment_1_0.rs index ae219a7c..b4b1d846 100644 --- a/tests/expectations/tests/16-byte-alignment_1_0.rs +++ b/tests/expectations/tests/16-byte-alignment_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -57,7 +60,8 @@ pub struct rte_ipv4_tuple { #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_ipv4_tuple__bindgen_ty_1 { - pub __bindgen_anon_1: __BindgenUnionField<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>, + pub __bindgen_anon_1: + __BindgenUnionField<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>, pub sctp_tag: __BindgenUnionField<u32>, pub bindgen_union_field: u32, } @@ -87,8 +91,9 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>())).dport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .dport as *const _ as usize }, 0usize, concat!( @@ -100,8 +105,9 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>())).sport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .sport as *const _ as usize }, 2usize, concat!( @@ -131,7 +137,8 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1>())).sctp_tag as *const _ as usize + &(*(::std::ptr::null::<rte_ipv4_tuple__bindgen_ty_1>())).sctp_tag + as *const _ as usize }, 0usize, concat!( @@ -160,7 +167,10 @@ fn bindgen_test_layout_rte_ipv4_tuple() { concat!("Alignment of ", stringify!(rte_ipv4_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv4_tuple>())).src_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv4_tuple>())).src_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -170,7 +180,10 @@ fn bindgen_test_layout_rte_ipv4_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv4_tuple>())).dst_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv4_tuple>())).dst_addr as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -195,7 +208,8 @@ pub struct rte_ipv6_tuple { #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_ipv6_tuple__bindgen_ty_1 { - pub __bindgen_anon_1: __BindgenUnionField<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>, + pub __bindgen_anon_1: + __BindgenUnionField<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>, pub sctp_tag: __BindgenUnionField<u32>, pub bindgen_union_field: u32, } @@ -225,8 +239,9 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>())).dport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .dport as *const _ as usize }, 0usize, concat!( @@ -238,8 +253,9 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>())).sport as *const _ - as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1__bindgen_ty_1>( + ))) + .sport as *const _ as usize }, 2usize, concat!( @@ -269,7 +285,8 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1>())).sctp_tag as *const _ as usize + &(*(::std::ptr::null::<rte_ipv6_tuple__bindgen_ty_1>())).sctp_tag + as *const _ as usize }, 0usize, concat!( @@ -298,7 +315,10 @@ fn bindgen_test_layout_rte_ipv6_tuple() { concat!("Alignment of ", stringify!(rte_ipv6_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv6_tuple>())).src_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv6_tuple>())).src_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -308,7 +328,10 @@ fn bindgen_test_layout_rte_ipv6_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ipv6_tuple>())).dst_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ipv6_tuple>())).dst_addr as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -338,7 +361,9 @@ fn bindgen_test_layout_rte_thash_tuple() { concat!("Size of: ", stringify!(rte_thash_tuple)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_thash_tuple>())).v4 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_thash_tuple>())).v4 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -348,7 +373,9 @@ fn bindgen_test_layout_rte_thash_tuple() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_thash_tuple>())).v6 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_thash_tuple>())).v6 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/381-decltype-alias.rs b/tests/expectations/tests/381-decltype-alias.rs index 7f2bb878..f8cf2029 100644 --- a/tests/expectations/tests/381-decltype-alias.rs +++ b/tests/expectations/tests/381-decltype-alias.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/accessors.rs b/tests/expectations/tests/accessors.rs index df52a6d5..514541e3 100644 --- a/tests/expectations/tests/accessors.rs +++ b/tests/expectations/tests/accessors.rs @@ -31,7 +31,10 @@ fn bindgen_test_layout_SomeAccessors() { concat!("Alignment of ", stringify!(SomeAccessors)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<SomeAccessors>())).mNoAccessor as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<SomeAccessors>())).mNoAccessor as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -41,7 +44,10 @@ fn bindgen_test_layout_SomeAccessors() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<SomeAccessors>())).mBothAccessors as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<SomeAccessors>())).mBothAccessors as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -51,7 +57,10 @@ fn bindgen_test_layout_SomeAccessors() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<SomeAccessors>())).mUnsafeAccessors as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<SomeAccessors>())).mUnsafeAccessors + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -62,7 +71,8 @@ fn bindgen_test_layout_SomeAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<SomeAccessors>())).mImmutableAccessor as *const _ as usize + &(*(::std::ptr::null::<SomeAccessors>())).mImmutableAccessor + as *const _ as usize }, 12usize, concat!( @@ -87,7 +97,9 @@ impl SomeAccessors { &self.mUnsafeAccessors } #[inline] - pub unsafe fn get_mUnsafeAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { + pub unsafe fn get_mUnsafeAccessors_mut( + &mut self, + ) -> &mut ::std::os::raw::c_int { &mut self.mUnsafeAccessors } #[inline] @@ -115,7 +127,10 @@ fn bindgen_test_layout_AllAccessors() { concat!("Alignment of ", stringify!(AllAccessors)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AllAccessors>())).mBothAccessors as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AllAccessors>())).mBothAccessors as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -125,7 +140,10 @@ fn bindgen_test_layout_AllAccessors() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AllAccessors>())).mAlsoBothAccessors as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AllAccessors>())).mAlsoBothAccessors + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -174,7 +192,8 @@ fn bindgen_test_layout_AllUnsafeAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<AllUnsafeAccessors>())).mBothAccessors as *const _ as usize + &(*(::std::ptr::null::<AllUnsafeAccessors>())).mBothAccessors + as *const _ as usize }, 0usize, concat!( @@ -186,7 +205,8 @@ fn bindgen_test_layout_AllUnsafeAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<AllUnsafeAccessors>())).mAlsoBothAccessors as *const _ as usize + &(*(::std::ptr::null::<AllUnsafeAccessors>())).mAlsoBothAccessors + as *const _ as usize }, 4usize, concat!( @@ -203,7 +223,9 @@ impl AllUnsafeAccessors { &self.mBothAccessors } #[inline] - pub unsafe fn get_mBothAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { + pub unsafe fn get_mBothAccessors_mut( + &mut self, + ) -> &mut ::std::os::raw::c_int { &mut self.mBothAccessors } #[inline] @@ -211,7 +233,9 @@ impl AllUnsafeAccessors { &self.mAlsoBothAccessors } #[inline] - pub unsafe fn get_mAlsoBothAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { + pub unsafe fn get_mAlsoBothAccessors_mut( + &mut self, + ) -> &mut ::std::os::raw::c_int { &mut self.mAlsoBothAccessors } } @@ -241,7 +265,8 @@ fn bindgen_test_layout_ContradictAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContradictAccessors>())).mBothAccessors as *const _ as usize + &(*(::std::ptr::null::<ContradictAccessors>())).mBothAccessors + as *const _ as usize }, 0usize, concat!( @@ -253,7 +278,8 @@ fn bindgen_test_layout_ContradictAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContradictAccessors>())).mNoAccessors as *const _ as usize + &(*(::std::ptr::null::<ContradictAccessors>())).mNoAccessors + as *const _ as usize }, 4usize, concat!( @@ -265,7 +291,8 @@ fn bindgen_test_layout_ContradictAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContradictAccessors>())).mUnsafeAccessors as *const _ as usize + &(*(::std::ptr::null::<ContradictAccessors>())).mUnsafeAccessors + as *const _ as usize }, 8usize, concat!( @@ -277,7 +304,8 @@ fn bindgen_test_layout_ContradictAccessors() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContradictAccessors>())).mImmutableAccessor as *const _ as usize + &(*(::std::ptr::null::<ContradictAccessors>())).mImmutableAccessor + as *const _ as usize }, 12usize, concat!( @@ -302,7 +330,9 @@ impl ContradictAccessors { &self.mUnsafeAccessors } #[inline] - pub unsafe fn get_mUnsafeAccessors_mut(&mut self) -> &mut ::std::os::raw::c_int { + pub unsafe fn get_mUnsafeAccessors_mut( + &mut self, + ) -> &mut ::std::os::raw::c_int { &mut self.mUnsafeAccessors } #[inline] @@ -329,7 +359,9 @@ fn bindgen_test_layout_Replaced() { concat!("Alignment of ", stringify!(Replaced)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Replaced>())).mAccessor as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Replaced>())).mAccessor as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -368,7 +400,9 @@ fn bindgen_test_layout_Wrapper() { concat!("Alignment of ", stringify!(Wrapper)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Wrapper>())).mReplaced as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Wrapper>())).mReplaced as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/annotation_hide.rs b/tests/expectations/tests/annotation_hide.rs index 49a771ac..b6a47cc0 100644 --- a/tests/expectations/tests/annotation_hide.rs +++ b/tests/expectations/tests/annotation_hide.rs @@ -45,7 +45,9 @@ fn bindgen_test_layout_NotAnnotated() { concat!("Alignment of ", stringify!(NotAnnotated)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<NotAnnotated>())).f as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<NotAnnotated>())).f as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/anon_enum.rs b/tests/expectations/tests/anon_enum.rs index 76d6089f..f2d9ec25 100644 --- a/tests/expectations/tests/anon_enum.rs +++ b/tests/expectations/tests/anon_enum.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] diff --git a/tests/expectations/tests/anon_enum_trait.rs b/tests/expectations/tests/anon_enum_trait.rs index e109c90d..64185491 100644 --- a/tests/expectations/tests/anon_enum_trait.rs +++ b/tests/expectations/tests/anon_enum_trait.rs @@ -16,11 +16,16 @@ pub type DataType_value_type<_Tp> = _Tp; pub type DataType_work_type<_Tp> = DataType_value_type<_Tp>; pub type DataType_channel_type<_Tp> = DataType_value_type<_Tp>; pub type DataType_vec_type<_Tp> = DataType_value_type<_Tp>; -pub const DataType_generic_type: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; -pub const DataType_depth: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; -pub const DataType_channels: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; -pub const DataType_fmt: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; -pub const DataType_type_: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; +pub const DataType_generic_type: DataType__bindgen_ty_1 = + DataType__bindgen_ty_1::generic_type; +pub const DataType_depth: DataType__bindgen_ty_1 = + DataType__bindgen_ty_1::generic_type; +pub const DataType_channels: DataType__bindgen_ty_1 = + DataType__bindgen_ty_1::generic_type; +pub const DataType_fmt: DataType__bindgen_ty_1 = + DataType__bindgen_ty_1::generic_type; +pub const DataType_type_: DataType__bindgen_ty_1 = + DataType__bindgen_ty_1::generic_type; #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum DataType__bindgen_ty_1 { diff --git a/tests/expectations/tests/anon_enum_whitelist.rs b/tests/expectations/tests/anon_enum_whitelist.rs index 267d9229..c109b317 100644 --- a/tests/expectations/tests/anon_enum_whitelist.rs +++ b/tests/expectations/tests/anon_enum_whitelist.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const NODE_FLAG_FOO: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_FOO; pub const NODE_FLAG_BAR: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_BAR; diff --git a/tests/expectations/tests/anon_struct_in_union.rs b/tests/expectations/tests/anon_struct_in_union.rs index 5b5ed43c..66c64c0f 100644 --- a/tests/expectations/tests/anon_struct_in_union.rs +++ b/tests/expectations/tests/anon_struct_in_union.rs @@ -36,7 +36,10 @@ fn bindgen_test_layout_s__bindgen_ty_1_inner() { concat!("Alignment of ", stringify!(s__bindgen_ty_1_inner)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<s__bindgen_ty_1_inner>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<s__bindgen_ty_1_inner>())).b as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -59,7 +62,10 @@ fn bindgen_test_layout_s__bindgen_ty_1() { concat!("Alignment of ", stringify!(s__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<s__bindgen_ty_1>())).field as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<s__bindgen_ty_1>())).field as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/anon_struct_in_union_1_0.rs b/tests/expectations/tests/anon_struct_in_union_1_0.rs index d8840029..725c4e22 100644 --- a/tests/expectations/tests/anon_struct_in_union_1_0.rs +++ b/tests/expectations/tests/anon_struct_in_union_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -76,7 +79,10 @@ fn bindgen_test_layout_s__bindgen_ty_1_inner() { concat!("Alignment of ", stringify!(s__bindgen_ty_1_inner)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<s__bindgen_ty_1_inner>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<s__bindgen_ty_1_inner>())).b as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -104,7 +110,10 @@ fn bindgen_test_layout_s__bindgen_ty_1() { concat!("Alignment of ", stringify!(s__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<s__bindgen_ty_1>())).field as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<s__bindgen_ty_1>())).field as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/anon_union.rs b/tests/expectations/tests/anon_union.rs index a9b60292..ff91944d 100644 --- a/tests/expectations/tests/anon_union.rs +++ b/tests/expectations/tests/anon_union.rs @@ -15,7 +15,8 @@ pub struct TErrorResult { pub mUnionState: TErrorResult_UnionState, } impl TErrorResult_UnionState { - pub const HasException: TErrorResult_UnionState = TErrorResult_UnionState::HasMessage; + pub const HasException: TErrorResult_UnionState = + TErrorResult_UnionState::HasMessage; } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/anon_union_1_0.rs b/tests/expectations/tests/anon_union_1_0.rs index e915237d..3397c551 100644 --- a/tests/expectations/tests/anon_union_1_0.rs +++ b/tests/expectations/tests/anon_union_1_0.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -74,7 +79,8 @@ pub struct TErrorResult_DOMExceptionInfo { #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct TErrorResult__bindgen_ty_1 { pub mMessage: __BindgenUnionField<*mut TErrorResult_Message>, - pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo>, + pub mDOMExceptionInfo: + __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo>, pub bindgen_union_field: u64, } impl Default for TErrorResult { diff --git a/tests/expectations/tests/anonymous-template-types.rs b/tests/expectations/tests/anonymous-template-types.rs index 0fedfe45..c2cff3b8 100644 --- a/tests/expectations/tests/anonymous-template-types.rs +++ b/tests/expectations/tests/anonymous-template-types.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/arg_keyword.rs b/tests/expectations/tests/arg_keyword.rs index 54c036d8..1aab5ce1 100644 --- a/tests/expectations/tests/arg_keyword.rs +++ b/tests/expectations/tests/arg_keyword.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { #[link_name = "\u{1}_Z3fooPKc"] diff --git a/tests/expectations/tests/array-of-zero-sized-types.rs b/tests/expectations/tests/array-of-zero-sized-types.rs index 65442b94..fa4d7a8a 100644 --- a/tests/expectations/tests/array-of-zero-sized-types.rs +++ b/tests/expectations/tests/array-of-zero-sized-types.rs @@ -46,7 +46,10 @@ fn bindgen_test_layout_HasArrayOfEmpty() { concat!("Alignment of ", stringify!(HasArrayOfEmpty)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<HasArrayOfEmpty>())).empties as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<HasArrayOfEmpty>())).empties as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/attribute_warn_unused_result.rs b/tests/expectations/tests/attribute_warn_unused_result.rs index 35ac4dd2..0230bc62 100644 --- a/tests/expectations/tests/attribute_warn_unused_result.rs +++ b/tests/expectations/tests/attribute_warn_unused_result.rs @@ -28,12 +28,18 @@ fn bindgen_test_layout_Foo() { extern "C" { #[must_use] #[link_name = "\u{1}_ZN3Foo3fooEi"] - pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn Foo_foo( + this: *mut Foo, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } impl Foo { #[inline] #[must_use] - pub unsafe fn foo(&mut self, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int { + pub unsafe fn foo( + &mut self, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int { Foo_foo(self, arg1) } } diff --git a/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs b/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs index c60b19c6..b1c6eb92 100644 --- a/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs +++ b/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs @@ -27,11 +27,17 @@ fn bindgen_test_layout_Foo() { } extern "C" { #[link_name = "\u{1}_ZN3Foo3fooEi"] - pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn Foo_foo( + this: *mut Foo, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } impl Foo { #[inline] - pub unsafe fn foo(&mut self, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int { + pub unsafe fn foo( + &mut self, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int { Foo_foo(self, arg1) } } diff --git a/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs b/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs index c60b19c6..b1c6eb92 100644 --- a/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs +++ b/tests/expectations/tests/attribute_warn_unused_result_pre_1_27.rs @@ -27,11 +27,17 @@ fn bindgen_test_layout_Foo() { } extern "C" { #[link_name = "\u{1}_ZN3Foo3fooEi"] - pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn Foo_foo( + this: *mut Foo, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } impl Foo { #[inline] - pub unsafe fn foo(&mut self, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int { + pub unsafe fn foo( + &mut self, + arg1: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int { Foo_foo(self, arg1) } } diff --git a/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs b/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs index 901bec60..7a4ac42e 100644 --- a/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs +++ b/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/base-to-derived.rs b/tests/expectations/tests/base-to-derived.rs index 9df54d98..528f1e17 100644 --- a/tests/expectations/tests/base-to-derived.rs +++ b/tests/expectations/tests/base-to-derived.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/bindgen-union-inside-namespace.rs b/tests/expectations/tests/bindgen-union-inside-namespace.rs index b2e6226c..1b5ff81f 100644 --- a/tests/expectations/tests/bindgen-union-inside-namespace.rs +++ b/tests/expectations/tests/bindgen-union-inside-namespace.rs @@ -39,7 +39,10 @@ pub mod root { } 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 { + fn fmt( + &self, + fmt: &mut ::std::fmt::Formatter<'_>, + ) -> ::std::fmt::Result { fmt.write_str("__BindgenUnionField") } } @@ -77,14 +80,28 @@ pub mod root { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(foo)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(foo) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).bar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).bar as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(bar)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(bar) + ) ); } impl Clone for Bar { diff --git a/tests/expectations/tests/bitfield-32bit-overflow.rs b/tests/expectations/tests/bitfield-32bit-overflow.rs index 361b0e3a..cfd00ac3 100644 --- a/tests/expectations/tests/bitfield-32bit-overflow.rs +++ b/tests/expectations/tests/bitfield-32bit-overflow.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -109,7 +115,9 @@ fn bindgen_test_layout_MuchBitfield() { impl MuchBitfield { #[inline] pub fn m0(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_m0(&mut self, val: ::std::os::raw::c_char) { @@ -120,7 +128,9 @@ impl MuchBitfield { } #[inline] pub fn m1(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) + } } #[inline] pub fn set_m1(&mut self, val: ::std::os::raw::c_char) { @@ -131,7 +141,9 @@ impl MuchBitfield { } #[inline] pub fn m2(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) + } } #[inline] pub fn set_m2(&mut self, val: ::std::os::raw::c_char) { @@ -142,7 +154,9 @@ impl MuchBitfield { } #[inline] pub fn m3(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) + } } #[inline] pub fn set_m3(&mut self, val: ::std::os::raw::c_char) { @@ -153,7 +167,9 @@ impl MuchBitfield { } #[inline] pub fn m4(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) + } } #[inline] pub fn set_m4(&mut self, val: ::std::os::raw::c_char) { @@ -164,7 +180,9 @@ impl MuchBitfield { } #[inline] pub fn m5(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) + } } #[inline] pub fn set_m5(&mut self, val: ::std::os::raw::c_char) { @@ -175,7 +193,9 @@ impl MuchBitfield { } #[inline] pub fn m6(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) + } } #[inline] pub fn set_m6(&mut self, val: ::std::os::raw::c_char) { @@ -186,7 +206,9 @@ impl MuchBitfield { } #[inline] pub fn m7(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) + } } #[inline] pub fn set_m7(&mut self, val: ::std::os::raw::c_char) { @@ -197,7 +219,9 @@ impl MuchBitfield { } #[inline] pub fn m8(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) + } } #[inline] pub fn set_m8(&mut self, val: ::std::os::raw::c_char) { @@ -208,7 +232,9 @@ impl MuchBitfield { } #[inline] pub fn m9(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u8) + } } #[inline] pub fn set_m9(&mut self, val: ::std::os::raw::c_char) { @@ -219,7 +245,9 @@ impl MuchBitfield { } #[inline] pub fn m10(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u8) + } } #[inline] pub fn set_m10(&mut self, val: ::std::os::raw::c_char) { @@ -230,7 +258,9 @@ impl MuchBitfield { } #[inline] pub fn m11(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u8) + } } #[inline] pub fn set_m11(&mut self, val: ::std::os::raw::c_char) { @@ -241,7 +271,9 @@ impl MuchBitfield { } #[inline] pub fn m12(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u8) + } } #[inline] pub fn set_m12(&mut self, val: ::std::os::raw::c_char) { @@ -252,7 +284,9 @@ impl MuchBitfield { } #[inline] pub fn m13(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u8) + } } #[inline] pub fn set_m13(&mut self, val: ::std::os::raw::c_char) { @@ -263,7 +297,9 @@ impl MuchBitfield { } #[inline] pub fn m14(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u8) + } } #[inline] pub fn set_m14(&mut self, val: ::std::os::raw::c_char) { @@ -274,7 +310,9 @@ impl MuchBitfield { } #[inline] pub fn m15(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u8) + } } #[inline] pub fn set_m15(&mut self, val: ::std::os::raw::c_char) { @@ -285,7 +323,9 @@ impl MuchBitfield { } #[inline] pub fn m16(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u8) + } } #[inline] pub fn set_m16(&mut self, val: ::std::os::raw::c_char) { @@ -296,7 +336,9 @@ impl MuchBitfield { } #[inline] pub fn m17(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u8) + } } #[inline] pub fn set_m17(&mut self, val: ::std::os::raw::c_char) { @@ -307,7 +349,9 @@ impl MuchBitfield { } #[inline] pub fn m18(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u8) + } } #[inline] pub fn set_m18(&mut self, val: ::std::os::raw::c_char) { @@ -318,7 +362,9 @@ impl MuchBitfield { } #[inline] pub fn m19(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u8) + } } #[inline] pub fn set_m19(&mut self, val: ::std::os::raw::c_char) { @@ -329,7 +375,9 @@ impl MuchBitfield { } #[inline] pub fn m20(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u8) + } } #[inline] pub fn set_m20(&mut self, val: ::std::os::raw::c_char) { @@ -340,7 +388,9 @@ impl MuchBitfield { } #[inline] pub fn m21(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u8) + } } #[inline] pub fn set_m21(&mut self, val: ::std::os::raw::c_char) { @@ -351,7 +401,9 @@ impl MuchBitfield { } #[inline] pub fn m22(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u8) + } } #[inline] pub fn set_m22(&mut self, val: ::std::os::raw::c_char) { @@ -362,7 +414,9 @@ impl MuchBitfield { } #[inline] pub fn m23(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u8) + } } #[inline] pub fn set_m23(&mut self, val: ::std::os::raw::c_char) { @@ -373,7 +427,9 @@ impl MuchBitfield { } #[inline] pub fn m24(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u8) + } } #[inline] pub fn set_m24(&mut self, val: ::std::os::raw::c_char) { @@ -384,7 +440,9 @@ impl MuchBitfield { } #[inline] pub fn m25(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u8) + } } #[inline] pub fn set_m25(&mut self, val: ::std::os::raw::c_char) { @@ -395,7 +453,9 @@ impl MuchBitfield { } #[inline] pub fn m26(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u8) + } } #[inline] pub fn set_m26(&mut self, val: ::std::os::raw::c_char) { @@ -406,7 +466,9 @@ impl MuchBitfield { } #[inline] pub fn m27(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u8) + } } #[inline] pub fn set_m27(&mut self, val: ::std::os::raw::c_char) { @@ -417,7 +479,9 @@ impl MuchBitfield { } #[inline] pub fn m28(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u8) + } } #[inline] pub fn set_m28(&mut self, val: ::std::os::raw::c_char) { @@ -428,7 +492,9 @@ impl MuchBitfield { } #[inline] pub fn m29(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u8) + } } #[inline] pub fn set_m29(&mut self, val: ::std::os::raw::c_char) { @@ -439,7 +505,9 @@ impl MuchBitfield { } #[inline] pub fn m30(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u8) + } } #[inline] pub fn set_m30(&mut self, val: ::std::os::raw::c_char) { @@ -450,7 +518,9 @@ impl MuchBitfield { } #[inline] pub fn m31(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) + } } #[inline] pub fn set_m31(&mut self, val: ::std::os::raw::c_char) { @@ -461,7 +531,9 @@ impl MuchBitfield { } #[inline] pub fn m32(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u8) + } } #[inline] pub fn set_m32(&mut self, val: ::std::os::raw::c_char) { @@ -506,8 +578,10 @@ impl MuchBitfield { m31: ::std::os::raw::c_char, m32: ::std::os::raw::c_char, ) -> __BindgenBitfieldUnit<[u8; 5usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 5usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 5usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let m0: u8 = unsafe { ::std::mem::transmute(m0) }; m0 as u64 diff --git a/tests/expectations/tests/bitfield-large.rs b/tests/expectations/tests/bitfield-large.rs index 6597e967..b3f4e5cf 100644 --- a/tests/expectations/tests/bitfield-large.rs +++ b/tests/expectations/tests/bitfield-large.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,7 +116,9 @@ fn bindgen_test_layout_HasBigBitfield() { impl HasBigBitfield { #[inline] pub fn x(&self) -> i128 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 128u8) as u128) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 128u8) as u128) + } } #[inline] pub fn set_x(&mut self, val: i128) { @@ -120,9 +128,13 @@ impl HasBigBitfield { } } #[inline] - pub fn new_bitfield_1(x: i128) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize], u64> = - Default::default(); + pub fn new_bitfield_1( + x: i128, + ) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 16usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 128u8, { let x: u128 = unsafe { ::std::mem::transmute(x) }; x as u64 @@ -152,7 +164,9 @@ fn bindgen_test_layout_HasTwoBigBitfields() { impl HasTwoBigBitfields { #[inline] pub fn x(&self) -> i128 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 80u8) as u128) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 80u8) as u128) + } } #[inline] pub fn set_x(&mut self, val: i128) { @@ -163,7 +177,9 @@ impl HasTwoBigBitfields { } #[inline] pub fn y(&self) -> i128 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(80usize, 48u8) as u128) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(80usize, 48u8) as u128) + } } #[inline] pub fn set_y(&mut self, val: i128) { @@ -173,9 +189,14 @@ impl HasTwoBigBitfields { } } #[inline] - pub fn new_bitfield_1(x: i128, y: i128) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize], u64> = - Default::default(); + pub fn new_bitfield_1( + x: i128, + y: i128, + ) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 16usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 80u8, { let x: u128 = unsafe { ::std::mem::transmute(x) }; x as u64 diff --git a/tests/expectations/tests/bitfield-method-same-name.rs b/tests/expectations/tests/bitfield-method-same-name.rs index a105f026..bea1734d 100644 --- a/tests/expectations/tests/bitfield-method-same-name.rs +++ b/tests/expectations/tests/bitfield-method-same-name.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -121,7 +127,9 @@ extern "C" { impl Foo { #[inline] pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) + } } #[inline] pub fn set_type__bindgen_bitfield(&mut self, val: ::std::os::raw::c_char) { @@ -134,8 +142,10 @@ impl Foo { pub fn new_bitfield_1( type__bindgen_bitfield: ::std::os::raw::c_char, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { let type__bindgen_bitfield: u8 = unsafe { ::std::mem::transmute(type__bindgen_bitfield) }; diff --git a/tests/expectations/tests/bitfield_align.rs b/tests/expectations/tests/bitfield_align.rs index 7fd1f2eb..3c6da122 100644 --- a/tests/expectations/tests/bitfield_align.rs +++ b/tests/expectations/tests/bitfield_align.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -122,7 +128,9 @@ fn bindgen_test_layout_A() { impl A { #[inline] pub fn b1(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) + } } #[inline] pub fn set_b1(&mut self, val: ::std::os::raw::c_uint) { @@ -133,7 +141,9 @@ impl A { } #[inline] pub fn b2(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) + } } #[inline] pub fn set_b2(&mut self, val: ::std::os::raw::c_uint) { @@ -144,7 +154,9 @@ impl A { } #[inline] pub fn b3(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) + } } #[inline] pub fn set_b3(&mut self, val: ::std::os::raw::c_uint) { @@ -155,7 +167,9 @@ impl A { } #[inline] pub fn b4(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) + } } #[inline] pub fn set_b4(&mut self, val: ::std::os::raw::c_uint) { @@ -166,7 +180,9 @@ impl A { } #[inline] pub fn b5(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) + } } #[inline] pub fn set_b5(&mut self, val: ::std::os::raw::c_uint) { @@ -177,7 +193,9 @@ impl A { } #[inline] pub fn b6(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) + } } #[inline] pub fn set_b6(&mut self, val: ::std::os::raw::c_uint) { @@ -188,7 +206,9 @@ impl A { } #[inline] pub fn b7(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) + } } #[inline] pub fn set_b7(&mut self, val: ::std::os::raw::c_uint) { @@ -199,7 +219,9 @@ impl A { } #[inline] pub fn b8(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) + } } #[inline] pub fn set_b8(&mut self, val: ::std::os::raw::c_uint) { @@ -210,7 +232,9 @@ impl A { } #[inline] pub fn b9(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) + } } #[inline] pub fn set_b9(&mut self, val: ::std::os::raw::c_uint) { @@ -221,7 +245,9 @@ impl A { } #[inline] pub fn b10(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) + } } #[inline] pub fn set_b10(&mut self, val: ::std::os::raw::c_uint) { @@ -243,8 +269,10 @@ impl A { b9: ::std::os::raw::c_uint, b10: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let b1: u32 = unsafe { ::std::mem::transmute(b1) }; b1 as u64 @@ -310,7 +338,9 @@ fn bindgen_test_layout_B() { impl B { #[inline] pub fn foo(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) + } } #[inline] pub fn set_foo(&mut self, val: ::std::os::raw::c_uint) { @@ -321,7 +351,9 @@ impl B { } #[inline] pub fn bar(&self) -> ::std::os::raw::c_uchar { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) + } } #[inline] pub fn set_bar(&mut self, val: ::std::os::raw::c_uchar) { @@ -335,8 +367,10 @@ impl B { foo: ::std::os::raw::c_uint, bar: ::std::os::raw::c_uchar, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 31u8, { let foo: u32 = unsafe { ::std::mem::transmute(foo) }; foo as u64 @@ -381,7 +415,9 @@ fn bindgen_test_layout_C() { impl C { #[inline] pub fn b1(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) + } } #[inline] pub fn set_b1(&mut self, val: ::std::os::raw::c_uint) { @@ -392,7 +428,9 @@ impl C { } #[inline] pub fn b2(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) + } } #[inline] pub fn set_b2(&mut self, val: ::std::os::raw::c_uint) { @@ -406,8 +444,10 @@ impl C { b1: ::std::os::raw::c_uint, b2: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let b1: u32 = unsafe { ::std::mem::transmute(b1) }; b1 as u64 @@ -442,7 +482,9 @@ fn bindgen_test_layout_Date1() { impl Date1 { #[inline] pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) + } } #[inline] pub fn set_nWeekDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -453,7 +495,9 @@ impl Date1 { } #[inline] pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) + } } #[inline] pub fn set_nMonthDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -464,7 +508,9 @@ impl Date1 { } #[inline] pub fn nMonth(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) + } } #[inline] pub fn set_nMonth(&mut self, val: ::std::os::raw::c_ushort) { @@ -475,7 +521,9 @@ impl Date1 { } #[inline] pub fn nYear(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) + } } #[inline] pub fn set_nYear(&mut self, val: ::std::os::raw::c_ushort) { @@ -491,8 +539,10 @@ impl Date1 { nMonth: ::std::os::raw::c_ushort, nYear: ::std::os::raw::c_ushort, ) -> __BindgenBitfieldUnit<[u8; 3usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 3usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { let nWeekDay: u16 = unsafe { ::std::mem::transmute(nWeekDay) }; nWeekDay as u64 @@ -534,7 +584,9 @@ fn bindgen_test_layout_Date2() { impl Date2 { #[inline] pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) + } } #[inline] pub fn set_nWeekDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -545,7 +597,9 @@ impl Date2 { } #[inline] pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) + } } #[inline] pub fn set_nMonthDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -556,7 +610,9 @@ impl Date2 { } #[inline] pub fn nMonth(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) + } } #[inline] pub fn set_nMonth(&mut self, val: ::std::os::raw::c_ushort) { @@ -567,7 +623,9 @@ impl Date2 { } #[inline] pub fn nYear(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) + } } #[inline] pub fn set_nYear(&mut self, val: ::std::os::raw::c_ushort) { @@ -578,7 +636,9 @@ impl Date2 { } #[inline] pub fn byte(&self) -> ::std::os::raw::c_uchar { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u8) + } } #[inline] pub fn set_byte(&mut self, val: ::std::os::raw::c_uchar) { @@ -595,8 +655,10 @@ impl Date2 { nYear: ::std::os::raw::c_ushort, byte: ::std::os::raw::c_uchar, ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { let nWeekDay: u16 = unsafe { ::std::mem::transmute(nWeekDay) }; nWeekDay as u64 @@ -653,7 +715,9 @@ fn bindgen_test_layout_Date3() { impl Date3 { #[inline] pub fn nWeekDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) + } } #[inline] pub fn set_nWeekDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -664,7 +728,9 @@ impl Date3 { } #[inline] pub fn nMonthDay(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 6u8) as u16) + } } #[inline] pub fn set_nMonthDay(&mut self, val: ::std::os::raw::c_ushort) { @@ -675,7 +741,9 @@ impl Date3 { } #[inline] pub fn nMonth(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) + } } #[inline] pub fn set_nMonth(&mut self, val: ::std::os::raw::c_ushort) { @@ -686,7 +754,9 @@ impl Date3 { } #[inline] pub fn nYear(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u16) + } } #[inline] pub fn set_nYear(&mut self, val: ::std::os::raw::c_ushort) { @@ -702,8 +772,10 @@ impl Date3 { nMonth: ::std::os::raw::c_ushort, nYear: ::std::os::raw::c_ushort, ) -> __BindgenBitfieldUnit<[u8; 3usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 3usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { let nWeekDay: u16 = unsafe { ::std::mem::transmute(nWeekDay) }; nWeekDay as u64 diff --git a/tests/expectations/tests/bitfield_align_2.rs b/tests/expectations/tests/bitfield_align_2.rs index ee3cfea5..277d8283 100644 --- a/tests/expectations/tests/bitfield_align_2.rs +++ b/tests/expectations/tests/bitfield_align_2.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -123,7 +129,9 @@ impl Default for TaggedPtr { impl TaggedPtr { #[inline] pub fn tag(&self) -> MyEnum { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) + } } #[inline] pub fn set_tag(&mut self, val: MyEnum) { @@ -134,7 +142,9 @@ impl TaggedPtr { } #[inline] pub fn ptr(&self) -> ::std::os::raw::c_long { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 62u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 62u8) as u64) + } } #[inline] pub fn set_ptr(&mut self, val: ::std::os::raw::c_long) { @@ -148,8 +158,10 @@ impl TaggedPtr { tag: MyEnum, ptr: ::std::os::raw::c_long, ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 2u8, { let tag: u32 = unsafe { ::std::mem::transmute(tag) }; tag as u64 diff --git a/tests/expectations/tests/bitfield_method_mangling.rs b/tests/expectations/tests/bitfield_method_mangling.rs index 9989bfe0..a08292d3 100644 --- a/tests/expectations/tests/bitfield_method_mangling.rs +++ b/tests/expectations/tests/bitfield_method_mangling.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,7 +116,9 @@ fn bindgen_test_layout_mach_msg_type_descriptor_t() { impl mach_msg_type_descriptor_t { #[inline] pub fn pad3(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) + } } #[inline] pub fn set_pad3(&mut self, val: ::std::os::raw::c_uint) { @@ -121,7 +129,9 @@ impl mach_msg_type_descriptor_t { } #[inline] pub fn type_(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) + } } #[inline] pub fn set_type(&mut self, val: ::std::os::raw::c_uint) { @@ -135,8 +145,10 @@ impl mach_msg_type_descriptor_t { pad3: ::std::os::raw::c_uint, type_: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 24u8, { let pad3: u32 = unsafe { ::std::mem::transmute(pad3) }; pad3 as u64 diff --git a/tests/expectations/tests/blacklist-and-impl-debug.rs b/tests/expectations/tests/blacklist-and-impl-debug.rs index 69f28a56..21c8d976 100644 --- a/tests/expectations/tests/blacklist-and-impl-debug.rs +++ b/tests/expectations/tests/blacklist-and-impl-debug.rs @@ -27,7 +27,10 @@ fn bindgen_test_layout_ShouldManuallyImplDebug() { concat!("Alignment of ", stringify!(ShouldManuallyImplDebug)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldManuallyImplDebug>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldManuallyImplDebug>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/block_return_type.rs b/tests/expectations/tests/block_return_type.rs index 7779540c..6809f609 100644 --- a/tests/expectations/tests/block_return_type.rs +++ b/tests/expectations/tests/block_return_type.rs @@ -12,5 +12,7 @@ extern crate block; extern "C" { pub fn func() -> _bindgen_ty_id_4; } -pub type _bindgen_ty_id_4 = - *const ::block::Block<(::std::os::raw::c_int, ::std::os::raw::c_int), ::std::os::raw::c_int>; +pub type _bindgen_ty_id_4 = *const ::block::Block< + (::std::os::raw::c_int, ::std::os::raw::c_int), + ::std::os::raw::c_int, +>; diff --git a/tests/expectations/tests/blocks-signature.rs b/tests/expectations/tests/blocks-signature.rs index d01e5172..a45af309 100644 --- a/tests/expectations/tests/blocks-signature.rs +++ b/tests/expectations/tests/blocks-signature.rs @@ -17,7 +17,10 @@ pub type dispatch_data_t = *mut ::std::os::raw::c_void; pub type dispatch_data_applier_t = _bindgen_ty_id_40; extern "C" { #[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] - pub fn dispatch_data_apply(data: dispatch_data_t, applier: dispatch_data_applier_t) -> bool; + pub fn dispatch_data_apply( + data: dispatch_data_t, + applier: dispatch_data_applier_t, + ) -> bool; } extern "C" { #[link_name = "\u{1}_Z3fooU13block_pointerFvyE"] @@ -46,7 +49,10 @@ fn bindgen_test_layout_contains_block_pointers() { concat!("Alignment of ", stringify!(contains_block_pointers)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<contains_block_pointers>())).val as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<contains_block_pointers>())).val as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -56,7 +62,10 @@ fn bindgen_test_layout_contains_block_pointers() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<contains_block_pointers>())).ptr_val as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<contains_block_pointers>())).ptr_val + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -72,10 +81,13 @@ impl Default for contains_block_pointers { } } pub type _bindgen_ty_id_33 = *const ::block::Block<(), ()>; -pub type _bindgen_ty_id_40 = - *const ::block::Block<(dispatch_data_t, usize, *const ::std::os::raw::c_void, usize), bool>; +pub type _bindgen_ty_id_40 = *const ::block::Block< + (dispatch_data_t, usize, *const ::std::os::raw::c_void, usize), + bool, +>; pub type _bindgen_ty_id_50 = *const ::block::Block<(usize,), ()>; pub type _bindgen_ty_id_56 = *const ::block::Block<(usize,), ()>; pub type contains_block_pointers__bindgen_ty_id_61 = *const ::block::Block<(::std::os::raw::c_int,), ()>; -pub type _bindgen_ty_id_68 = *const ::block::Block<(::std::os::raw::c_int,), ()>; +pub type _bindgen_ty_id_68 = + *const ::block::Block<(::std::os::raw::c_int,), ()>; diff --git a/tests/expectations/tests/blocks.rs b/tests/expectations/tests/blocks.rs index 1e1def7f..6a0dac19 100644 --- a/tests/expectations/tests/blocks.rs +++ b/tests/expectations/tests/blocks.rs @@ -16,7 +16,10 @@ pub type dispatch_data_t = *mut ::std::os::raw::c_void; pub type dispatch_data_applier_t = *mut ::std::os::raw::c_void; extern "C" { #[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] - pub fn dispatch_data_apply(data: dispatch_data_t, applier: dispatch_data_applier_t) -> bool; + pub fn dispatch_data_apply( + data: dispatch_data_t, + applier: dispatch_data_applier_t, + ) -> bool; } extern "C" { #[link_name = "\u{1}_Z3fooU13block_pointerFvyE"] @@ -45,7 +48,10 @@ fn bindgen_test_layout_contains_block_pointers() { concat!("Alignment of ", stringify!(contains_block_pointers)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<contains_block_pointers>())).val as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<contains_block_pointers>())).val as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -55,7 +61,10 @@ fn bindgen_test_layout_contains_block_pointers() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<contains_block_pointers>())).ptr_val as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<contains_block_pointers>())).ptr_val + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/builtin-template.rs b/tests/expectations/tests/builtin-template.rs index 398c3c4a..0a6ded49 100644 --- a/tests/expectations/tests/builtin-template.rs +++ b/tests/expectations/tests/builtin-template.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type std_make_integer_sequence = u8; diff --git a/tests/expectations/tests/c-empty-layout.rs b/tests/expectations/tests/c-empty-layout.rs index a14022f5..1ed41db8 100644 --- a/tests/expectations/tests/c-empty-layout.rs +++ b/tests/expectations/tests/c-empty-layout.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/call-conv-typedef.rs b/tests/expectations/tests/call-conv-typedef.rs index f30d2356..db37da0e 100644 --- a/tests/expectations/tests/call-conv-typedef.rs +++ b/tests/expectations/tests/call-conv-typedef.rs @@ -9,5 +9,6 @@ #![cfg(not(test))] pub type void_fn = ::std::option::Option<unsafe extern "stdcall" fn()>; -pub type fn_ = - ::std::option::Option<unsafe extern "stdcall" fn(id: ::std::os::raw::c_int) -> void_fn>; +pub type fn_ = ::std::option::Option< + unsafe extern "stdcall" fn(id: ::std::os::raw::c_int) -> void_fn, +>; diff --git a/tests/expectations/tests/canonical_path_without_namespacing.rs b/tests/expectations/tests/canonical_path_without_namespacing.rs index 02955e44..cdc5b512 100644 --- a/tests/expectations/tests/canonical_path_without_namespacing.rs +++ b/tests/expectations/tests/canonical_path_without_namespacing.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/char.rs b/tests/expectations/tests/char.rs index ffaae3d1..55303e5d 100644 --- a/tests/expectations/tests/char.rs +++ b/tests/expectations/tests/char.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type Char = ::std::os::raw::c_char; pub type SChar = ::std::os::raw::c_schar; diff --git a/tests/expectations/tests/class.rs b/tests/expectations/tests/class.rs index be138041..3a9927bc 100644 --- a/tests/expectations/tests/class.rs +++ b/tests/expectations/tests/class.rs @@ -101,7 +101,10 @@ fn bindgen_test_layout_C_with_zero_length_array() { concat!("Alignment of ", stringify!(C_with_zero_length_array)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_with_zero_length_array>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_with_zero_length_array>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -112,7 +115,8 @@ fn bindgen_test_layout_C_with_zero_length_array() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array>())).big_array as *const _ as usize + &(*(::std::ptr::null::<C_with_zero_length_array>())).big_array + as *const _ as usize }, 4usize, concat!( @@ -124,8 +128,8 @@ fn bindgen_test_layout_C_with_zero_length_array() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array>())).zero_length_array as *const _ - as usize + &(*(::std::ptr::null::<C_with_zero_length_array>())) + .zero_length_array as *const _ as usize }, 37usize, concat!( @@ -160,7 +164,10 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { concat!("Alignment of ", stringify!(C_with_zero_length_array_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_with_zero_length_array_2>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_with_zero_length_array_2>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -171,8 +178,8 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array_2>())).zero_length_array as *const _ - as usize + &(*(::std::ptr::null::<C_with_zero_length_array_2>())) + .zero_length_array as *const _ as usize }, 4usize, concat!( @@ -267,7 +274,8 @@ pub struct C_with_zero_length_array_and_incomplete_array_2 { #[test] fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() { assert_eq!( - ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(), + ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>( + ), 4usize, concat!( "Size of: ", @@ -275,7 +283,8 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() { ) ); assert_eq!( - ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>(), + ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>( + ), 4usize, concat!( "Alignment of ", @@ -387,7 +396,9 @@ fn bindgen_test_layout_WithUnion() { concat!("Alignment of ", stringify!(WithUnion)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithUnion>())).data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithUnion>())).data as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -425,11 +436,15 @@ fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() { } extern "C" { #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar(this: *const RealAbstractionWithTonsOfMethods); + pub fn RealAbstractionWithTonsOfMethods_bar( + this: *const RealAbstractionWithTonsOfMethods, + ); } extern "C" { #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar1(this: *mut RealAbstractionWithTonsOfMethods); + pub fn RealAbstractionWithTonsOfMethods_bar1( + this: *mut RealAbstractionWithTonsOfMethods, + ); } extern "C" { #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"] diff --git a/tests/expectations/tests/class_1_0.rs b/tests/expectations/tests/class_1_0.rs index b35e8814..b1ac5502 100644 --- a/tests/expectations/tests/class_1_0.rs +++ b/tests/expectations/tests/class_1_0.rs @@ -154,7 +154,10 @@ fn bindgen_test_layout_C_with_zero_length_array() { concat!("Alignment of ", stringify!(C_with_zero_length_array)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_with_zero_length_array>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_with_zero_length_array>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -165,7 +168,8 @@ fn bindgen_test_layout_C_with_zero_length_array() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array>())).big_array as *const _ as usize + &(*(::std::ptr::null::<C_with_zero_length_array>())).big_array + as *const _ as usize }, 4usize, concat!( @@ -177,8 +181,8 @@ fn bindgen_test_layout_C_with_zero_length_array() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array>())).zero_length_array as *const _ - as usize + &(*(::std::ptr::null::<C_with_zero_length_array>())) + .zero_length_array as *const _ as usize }, 37usize, concat!( @@ -213,7 +217,10 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { concat!("Alignment of ", stringify!(C_with_zero_length_array_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_with_zero_length_array_2>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_with_zero_length_array_2>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -224,8 +231,8 @@ fn bindgen_test_layout_C_with_zero_length_array_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C_with_zero_length_array_2>())).zero_length_array as *const _ - as usize + &(*(::std::ptr::null::<C_with_zero_length_array_2>())) + .zero_length_array as *const _ as usize }, 4usize, concat!( @@ -320,7 +327,8 @@ pub struct C_with_zero_length_array_and_incomplete_array_2 { #[test] fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() { assert_eq!( - ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>(), + ::std::mem::size_of::<C_with_zero_length_array_and_incomplete_array_2>( + ), 4usize, concat!( "Size of: ", @@ -328,7 +336,8 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array_2() { ) ); assert_eq!( - ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>(), + ::std::mem::align_of::<C_with_zero_length_array_and_incomplete_array_2>( + ), 4usize, concat!( "Alignment of ", @@ -440,7 +449,9 @@ fn bindgen_test_layout_WithUnion() { concat!("Alignment of ", stringify!(WithUnion)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithUnion>())).data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithUnion>())).data as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -478,11 +489,15 @@ fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() { } extern "C" { #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar(this: *const RealAbstractionWithTonsOfMethods); + pub fn RealAbstractionWithTonsOfMethods_bar( + this: *const RealAbstractionWithTonsOfMethods, + ); } extern "C" { #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"] - pub fn RealAbstractionWithTonsOfMethods_bar1(this: *mut RealAbstractionWithTonsOfMethods); + pub fn RealAbstractionWithTonsOfMethods_bar1( + this: *mut RealAbstractionWithTonsOfMethods, + ); } extern "C" { #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"] diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs index efd7dac2..80cb621f 100644 --- a/tests/expectations/tests/class_nested.rs +++ b/tests/expectations/tests/class_nested.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -27,7 +30,9 @@ fn bindgen_test_layout_A_B() { concat!("Alignment of ", stringify!(A_B)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A_B>())).member_b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A_B>())).member_b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/class_no_members.rs b/tests/expectations/tests/class_no_members.rs index 7da77892..729e517a 100644 --- a/tests/expectations/tests/class_no_members.rs +++ b/tests/expectations/tests/class_no_members.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -59,7 +62,8 @@ fn bindgen_test_layout_whatever_child_with_member() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<whatever_child_with_member>())).m_member as *const _ as usize + &(*(::std::ptr::null::<whatever_child_with_member>())).m_member + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/class_static.rs b/tests/expectations/tests/class_static.rs index c28366c1..979c51cb 100644 --- a/tests/expectations/tests/class_static.rs +++ b/tests/expectations/tests/class_static.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -15,7 +18,8 @@ extern "C" { } extern "C" { #[link_name = "\u{1}_ZN7MyClass26example_check_no_collisionE"] - pub static mut MyClass_example_check_no_collision: *const ::std::os::raw::c_int; + pub static mut MyClass_example_check_no_collision: + *const ::std::os::raw::c_int; } #[test] fn bindgen_test_layout_MyClass() { diff --git a/tests/expectations/tests/class_static_const.rs b/tests/expectations/tests/class_static_const.rs index c0945c43..9e4841d3 100644 --- a/tests/expectations/tests/class_static_const.rs +++ b/tests/expectations/tests/class_static_const.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/class_use_as.rs b/tests/expectations/tests/class_use_as.rs index d1f6a5c0..c88f25c5 100644 --- a/tests/expectations/tests/class_use_as.rs +++ b/tests/expectations/tests/class_use_as.rs @@ -26,7 +26,10 @@ fn bindgen_test_layout_whatever() { concat!("Alignment of ", stringify!(whatever)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<whatever>())).replacement as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<whatever>())).replacement as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs index 4a5b090d..9baa1b4d 100644 --- a/tests/expectations/tests/class_with_dtor.rs +++ b/tests/expectations/tests/class_with_dtor.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Hash, PartialEq, Eq)] @@ -34,7 +37,10 @@ fn bindgen_test_layout_WithoutDtor() { concat!("Alignment of ", stringify!(WithoutDtor)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithoutDtor>())).shouldBeWithDtor as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithoutDtor>())).shouldBeWithDtor as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/class_with_inner_struct.rs b/tests/expectations/tests/class_with_inner_struct.rs index 577dec6f..939143d6 100644 --- a/tests/expectations/tests/class_with_inner_struct.rs +++ b/tests/expectations/tests/class_with_inner_struct.rs @@ -33,7 +33,9 @@ fn bindgen_test_layout_A_Segment() { concat!("Alignment of ", stringify!(A_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -43,7 +45,9 @@ fn bindgen_test_layout_A_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -72,7 +76,9 @@ fn bindgen_test_layout_A__bindgen_ty_1() { concat!("Alignment of ", stringify!(A__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A__bindgen_ty_1>())).f as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A__bindgen_ty_1>())).f as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -106,7 +112,9 @@ fn bindgen_test_layout_A__bindgen_ty_2() { concat!("Alignment of ", stringify!(A__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A__bindgen_ty_2>())).d as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A__bindgen_ty_2>())).d as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -139,7 +147,9 @@ fn bindgen_test_layout_A() { concat!("Offset of field: ", stringify!(A), "::", stringify!(c)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A>())).named_union as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A>())).named_union as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -178,7 +188,9 @@ fn bindgen_test_layout_B_Segment() { concat!("Alignment of ", stringify!(B_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<B_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<B_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -188,7 +200,9 @@ fn bindgen_test_layout_B_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<B_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<B_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -259,7 +273,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX1 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX1 + as *const _ as usize }, 0usize, concat!( @@ -271,7 +286,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY1 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY1 + as *const _ as usize }, 4usize, concat!( @@ -283,7 +299,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX2 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX2 + as *const _ as usize }, 8usize, concat!( @@ -295,7 +312,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY2 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY2 + as *const _ as usize }, 12usize, concat!( @@ -326,8 +344,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mStepSyntax as *const _ - as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())) + .mStepSyntax as *const _ as usize }, 0usize, concat!( @@ -339,7 +357,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mSteps as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mSteps + as *const _ as usize }, 4usize, concat!( @@ -368,7 +387,10 @@ fn bindgen_test_layout_C__bindgen_ty_1() { concat!("Alignment of ", stringify!(C__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C__bindgen_ty_1>())).mFunc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C__bindgen_ty_1>())).mFunc as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -402,7 +424,9 @@ fn bindgen_test_layout_C_Segment() { concat!("Alignment of ", stringify!(C_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -412,7 +436,9 @@ fn bindgen_test_layout_C_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/class_with_inner_struct_1_0.rs b/tests/expectations/tests/class_with_inner_struct_1_0.rs index 3a8ca37a..3fd71bd0 100644 --- a/tests/expectations/tests/class_with_inner_struct_1_0.rs +++ b/tests/expectations/tests/class_with_inner_struct_1_0.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -71,7 +76,9 @@ fn bindgen_test_layout_A_Segment() { concat!("Alignment of ", stringify!(A_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -81,7 +88,9 @@ fn bindgen_test_layout_A_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -115,7 +124,9 @@ fn bindgen_test_layout_A__bindgen_ty_1() { concat!("Alignment of ", stringify!(A__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A__bindgen_ty_1>())).f as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A__bindgen_ty_1>())).f as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -149,7 +160,9 @@ fn bindgen_test_layout_A__bindgen_ty_2() { concat!("Alignment of ", stringify!(A__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A__bindgen_ty_2>())).d as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A__bindgen_ty_2>())).d as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -182,7 +195,9 @@ fn bindgen_test_layout_A() { concat!("Offset of field: ", stringify!(A), "::", stringify!(c)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<A>())).named_union as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<A>())).named_union as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -221,7 +236,9 @@ fn bindgen_test_layout_B_Segment() { concat!("Alignment of ", stringify!(B_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<B_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<B_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -231,7 +248,9 @@ fn bindgen_test_layout_B_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<B_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<B_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -312,7 +331,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX1 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX1 + as *const _ as usize }, 0usize, concat!( @@ -324,7 +344,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY1 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY1 + as *const _ as usize }, 4usize, concat!( @@ -336,7 +357,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX2 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mX2 + as *const _ as usize }, 8usize, concat!( @@ -348,7 +370,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY2 as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_1>())).mY2 + as *const _ as usize }, 12usize, concat!( @@ -384,8 +407,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mStepSyntax as *const _ - as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())) + .mStepSyntax as *const _ as usize }, 0usize, concat!( @@ -397,7 +420,8 @@ fn bindgen_test_layout_C__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mSteps as *const _ as usize + &(*(::std::ptr::null::<C__bindgen_ty_1__bindgen_ty_2>())).mSteps + as *const _ as usize }, 4usize, concat!( @@ -431,7 +455,10 @@ fn bindgen_test_layout_C__bindgen_ty_1() { concat!("Alignment of ", stringify!(C__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C__bindgen_ty_1>())).mFunc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C__bindgen_ty_1>())).mFunc as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -465,7 +492,9 @@ fn bindgen_test_layout_C_Segment() { concat!("Alignment of ", stringify!(C_Segment)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_Segment>())).begin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_Segment>())).begin as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -475,7 +504,9 @@ fn bindgen_test_layout_C_Segment() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C_Segment>())).end as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C_Segment>())).end as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/class_with_typedef.rs b/tests/expectations/tests/class_with_typedef.rs index 221ed5d7..597b5cdb 100644 --- a/tests/expectations/tests/class_with_typedef.rs +++ b/tests/expectations/tests/class_with_typedef.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type AnotherInt = ::std::os::raw::c_int; #[repr(C)] diff --git a/tests/expectations/tests/comment-indent.rs b/tests/expectations/tests/comment-indent.rs index 2e44746d..e208b3bd 100644 --- a/tests/expectations/tests/comment-indent.rs +++ b/tests/expectations/tests/comment-indent.rs @@ -83,7 +83,9 @@ pub mod root { concat!("Alignment of ", stringify!(Baz)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Baz>())).member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Baz>())).member as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/complex.rs b/tests/expectations/tests/complex.rs index 317bb99a..f40e53a0 100644 --- a/tests/expectations/tests/complex.rs +++ b/tests/expectations/tests/complex.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] #[repr(C)] @@ -28,7 +31,9 @@ fn bindgen_test_layout_TestDouble() { concat!("Alignment of ", stringify!(TestDouble)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<TestDouble>())).mMember as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<TestDouble>())).mMember as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -56,7 +61,10 @@ fn bindgen_test_layout_TestDoublePtr() { concat!("Alignment of ", stringify!(TestDoublePtr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<TestDoublePtr>())).mMember as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<TestDoublePtr>())).mMember as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +97,9 @@ fn bindgen_test_layout_TestFloat() { concat!("Alignment of ", stringify!(TestFloat)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<TestFloat>())).mMember as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<TestFloat>())).mMember as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -117,7 +127,10 @@ fn bindgen_test_layout_TestFloatPtr() { concat!("Alignment of ", stringify!(TestFloatPtr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<TestFloatPtr>())).mMember as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<TestFloatPtr>())).mMember as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/complex_global.rs b/tests/expectations/tests/complex_global.rs index 417ccd4a..0ce2f7f3 100644 --- a/tests/expectations/tests/complex_global.rs +++ b/tests/expectations/tests/complex_global.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[derive(PartialEq, Copy, Clone, Hash, Debug, Default)] #[repr(C)] diff --git a/tests/expectations/tests/const-const-mut-ptr.rs b/tests/expectations/tests/const-const-mut-ptr.rs index ecfbf58f..b2140116 100644 --- a/tests/expectations/tests/const-const-mut-ptr.rs +++ b/tests/expectations/tests/const-const-mut-ptr.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/const_array_fn_arg.rs b/tests/expectations/tests/const_array_fn_arg.rs index 5e934bcb..289be368 100644 --- a/tests/expectations/tests/const_array_fn_arg.rs +++ b/tests/expectations/tests/const_array_fn_arg.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn f(a: *const ::std::os::raw::c_int); diff --git a/tests/expectations/tests/const_enum_unnamed.rs b/tests/expectations/tests/const_enum_unnamed.rs index 6b04c7dd..ea5a8f05 100644 --- a/tests/expectations/tests/const_enum_unnamed.rs +++ b/tests/expectations/tests/const_enum_unnamed.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const FOO_BAR: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAR; pub const FOO_BAZ: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAZ; diff --git a/tests/expectations/tests/const_ptr.rs b/tests/expectations/tests/const_ptr.rs index 9831cd8d..4f2e60bc 100644 --- a/tests/expectations/tests/const_ptr.rs +++ b/tests/expectations/tests/const_ptr.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(bar: *const ::std::os::raw::c_void); diff --git a/tests/expectations/tests/const_resolved_ty.rs b/tests/expectations/tests/const_resolved_ty.rs index 7c4b91b0..536fee96 100644 --- a/tests/expectations/tests/const_resolved_ty.rs +++ b/tests/expectations/tests/const_resolved_ty.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(foo: *const u8); diff --git a/tests/expectations/tests/const_tparam.rs b/tests/expectations/tests/const_tparam.rs index c7863931..2512d17d 100644 --- a/tests/expectations/tests/const_tparam.rs +++ b/tests/expectations/tests/const_tparam.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/constant-non-specialized-tp.rs b/tests/expectations/tests/constant-non-specialized-tp.rs index 8be8e5d3..ece462ab 100644 --- a/tests/expectations/tests/constant-non-specialized-tp.rs +++ b/tests/expectations/tests/constant-non-specialized-tp.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/constify-all-enums.rs b/tests/expectations/tests/constify-all-enums.rs index b2e1e974..6a8dc3e3 100644 --- a/tests/expectations/tests/constify-all-enums.rs +++ b/tests/expectations/tests/constify-all-enums.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const foo_THIS: foo = 0; pub const foo_SHOULD_BE: foo = 1; @@ -24,7 +29,10 @@ fn bindgen_test_layout_bar() { concat!("Alignment of ", stringify!(bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<bar>())).this_should_work as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<bar>())).this_should_work as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/constify-enum.rs b/tests/expectations/tests/constify-enum.rs index f1dc139c..24d6ce20 100644 --- a/tests/expectations/tests/constify-enum.rs +++ b/tests/expectations/tests/constify-enum.rs @@ -7,10 +7,12 @@ non_upper_case_globals )] -pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: nsCSSPropertyID = +pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: + nsCSSPropertyID = nsCSSPropertyID::eCSSProperty_COUNT_unexistingVariantValue; impl nsCSSPropertyID { - pub const eCSSProperty_COUNT: nsCSSPropertyID = nsCSSPropertyID::eCSSPropertyAlias_aa; + pub const eCSSProperty_COUNT: nsCSSPropertyID = + nsCSSPropertyID::eCSSPropertyAlias_aa; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/constify-module-enums-basic.rs b/tests/expectations/tests/constify-module-enums-basic.rs index 342e5ba5..db200587 100644 --- a/tests/expectations/tests/constify-module-enums-basic.rs +++ b/tests/expectations/tests/constify-module-enums-basic.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod foo { pub type Type = u32; @@ -28,7 +33,10 @@ fn bindgen_test_layout_bar() { concat!("Alignment of ", stringify!(bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<bar>())).this_should_work as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<bar>())).this_should_work as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/constify-module-enums-namespace.rs b/tests/expectations/tests/constify-module-enums-namespace.rs index 7f1c134d..a15157eb 100644 --- a/tests/expectations/tests/constify-module-enums-namespace.rs +++ b/tests/expectations/tests/constify-module-enums-namespace.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -41,7 +46,8 @@ pub mod root { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<bar>())).this_should_work as *const _ as usize + &(*(::std::ptr::null::<bar>())).this_should_work + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/constify-module-enums-shadow-name.rs b/tests/expectations/tests/constify-module-enums-shadow-name.rs index 96428717..636aa6fc 100644 --- a/tests/expectations/tests/constify-module-enums-shadow-name.rs +++ b/tests/expectations/tests/constify-module-enums-shadow-name.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod foo { pub type Type = u32; diff --git a/tests/expectations/tests/constify-module-enums-simple-alias.rs b/tests/expectations/tests/constify-module-enums-simple-alias.rs index 70c881b9..3a7e1116 100644 --- a/tests/expectations/tests/constify-module-enums-simple-alias.rs +++ b/tests/expectations/tests/constify-module-enums-simple-alias.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod Foo { pub type Type = i32; @@ -56,7 +61,9 @@ fn bindgen_test_layout_Bar() { concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).baz_ptr1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).baz_ptr1 as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -66,7 +73,9 @@ fn bindgen_test_layout_Bar() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).baz_ptr2 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).baz_ptr2 as *const _ as usize + }, 24usize, concat!( "Offset of field: ", @@ -76,7 +85,9 @@ fn bindgen_test_layout_Bar() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).baz_ptr3 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).baz_ptr3 as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -86,7 +97,9 @@ fn bindgen_test_layout_Bar() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).baz_ptr4 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).baz_ptr4 as *const _ as usize + }, 40usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs b/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs index ee15b57b..fe58fc8e 100644 --- a/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs +++ b/tests/expectations/tests/constify-module-enums-simple-nonamespace.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod one_Foo { pub type Type = i32; diff --git a/tests/expectations/tests/constify-module-enums-types.rs b/tests/expectations/tests/constify-module-enums-types.rs index 155839be..bbb6308a 100644 --- a/tests/expectations/tests/constify-module-enums-types.rs +++ b/tests/expectations/tests/constify-module-enums-types.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod foo { pub type Type = u32; @@ -28,12 +33,12 @@ pub mod ns2_Foo { pub const Variant1: Type = 0; pub const Variant2: Type = 1; } -pub use self::foo::Type as foo_alias1; -pub use self::foo_alias1 as foo_alias2; -pub use self::foo_alias2 as foo_alias3; pub use self::anon_enum::Type as anon_enum_alias1; pub use self::anon_enum_alias1 as anon_enum_alias2; pub use self::anon_enum_alias2 as anon_enum_alias3; +pub use self::foo::Type as foo_alias1; +pub use self::foo_alias1 as foo_alias2; +pub use self::foo_alias2 as foo_alias3; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bar { @@ -151,7 +156,9 @@ fn bindgen_test_layout_bar() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<bar>())).member10 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<bar>())).member10 as *const _ as usize + }, 44usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/constructor-tp.rs b/tests/expectations/tests/constructor-tp.rs index 73360248..c547206b 100644 --- a/tests/expectations/tests/constructor-tp.rs +++ b/tests/expectations/tests/constructor-tp.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/constructors.rs b/tests/expectations/tests/constructors.rs index b20e3f44..d8099db5 100644 --- a/tests/expectations/tests/constructors.rs +++ b/tests/expectations/tests/constructors.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -24,7 +27,10 @@ fn bindgen_test_layout_TestOverload() { } extern "C" { #[link_name = "\u{1}_ZN12TestOverloadC1Ei"] - pub fn TestOverload_TestOverload(this: *mut TestOverload, arg1: ::std::os::raw::c_int); + pub fn TestOverload_TestOverload( + this: *mut TestOverload, + arg1: ::std::os::raw::c_int, + ); } extern "C" { #[link_name = "\u{1}_ZN12TestOverloadC1Ed"] diff --git a/tests/expectations/tests/contains-vs-inherits-zero-sized.rs b/tests/expectations/tests/contains-vs-inherits-zero-sized.rs index 9036b12f..61730fb6 100644 --- a/tests/expectations/tests/contains-vs-inherits-zero-sized.rs +++ b/tests/expectations/tests/contains-vs-inherits-zero-sized.rs @@ -77,7 +77,9 @@ fn bindgen_test_layout_Contains() { concat!("Alignment of ", stringify!(Contains)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Contains>())).empty as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Contains>())).empty as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/convert-cpp-comment-to-rust.rs b/tests/expectations/tests/convert-cpp-comment-to-rust.rs index 8058af10..ba8359e1 100644 --- a/tests/expectations/tests/convert-cpp-comment-to-rust.rs +++ b/tests/expectations/tests/convert-cpp-comment-to-rust.rs @@ -32,7 +32,9 @@ fn bindgen_test_layout_mbedtls_mpi() { concat!("Alignment of ", stringify!(mbedtls_mpi)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<mbedtls_mpi>())).s as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<mbedtls_mpi>())).s as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_mbedtls_mpi() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<mbedtls_mpi>())).n as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<mbedtls_mpi>())).n as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -52,7 +56,9 @@ fn bindgen_test_layout_mbedtls_mpi() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<mbedtls_mpi>())).p as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<mbedtls_mpi>())).p as *const _ as usize + }, 16usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/convert-floats.rs b/tests/expectations/tests/convert-floats.rs index 325fc267..2083b4d2 100644 --- a/tests/expectations/tests/convert-floats.rs +++ b/tests/expectations/tests/convert-floats.rs @@ -61,7 +61,9 @@ fn bindgen_test_layout_foo() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo>())).complexFloat as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo>())).complexFloat as *const _ as usize + }, 24usize, concat!( "Offset of field: ", @@ -71,7 +73,9 @@ fn bindgen_test_layout_foo() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo>())).complexDouble as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo>())).complexDouble as *const _ as usize + }, 32usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/cpp-empty-layout.rs b/tests/expectations/tests/cpp-empty-layout.rs index 36cae722..f14057bf 100644 --- a/tests/expectations/tests/cpp-empty-layout.rs +++ b/tests/expectations/tests/cpp-empty-layout.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/crtp.rs b/tests/expectations/tests/crtp.rs index c56cceb2..4e6d7da7 100644 --- a/tests/expectations/tests/crtp.rs +++ b/tests/expectations/tests/crtp.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/dash_language.rs b/tests/expectations/tests/dash_language.rs index f6d15d1c..ed60dcf8 100644 --- a/tests/expectations/tests/dash_language.rs +++ b/tests/expectations/tests/dash_language.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/decl_extern_int_twice.rs b/tests/expectations/tests/decl_extern_int_twice.rs index 04a53e51..6cf37251 100644 --- a/tests/expectations/tests/decl_extern_int_twice.rs +++ b/tests/expectations/tests/decl_extern_int_twice.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub static mut foo: ::std::os::raw::c_int; diff --git a/tests/expectations/tests/decl_ptr_to_array.rs b/tests/expectations/tests/decl_ptr_to_array.rs index 0750bbbb..fc6184d5 100644 --- a/tests/expectations/tests/decl_ptr_to_array.rs +++ b/tests/expectations/tests/decl_ptr_to_array.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub static mut foo: *mut [::std::os::raw::c_int; 1usize]; diff --git a/tests/expectations/tests/default-template-parameter.rs b/tests/expectations/tests/default-template-parameter.rs index 8d4ba3dd..b4388fe2 100644 --- a/tests/expectations/tests/default-template-parameter.rs +++ b/tests/expectations/tests/default-template-parameter.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/derive-bitfield-method-same-name.rs b/tests/expectations/tests/derive-bitfield-method-same-name.rs index abe57781..b86b807a 100644 --- a/tests/expectations/tests/derive-bitfield-method-same-name.rs +++ b/tests/expectations/tests/derive-bitfield-method-same-name.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -146,7 +152,11 @@ impl ::std::fmt::Debug for Foo { self.large .iter() .enumerate() - .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v)) + .map(|(i, v)| format!( + "{}{:?}", + if i > 0 { ", " } else { "" }, + v + )) .collect::<String>(), self.type__bindgen_bitfield() ) @@ -154,14 +164,16 @@ impl ::std::fmt::Debug for Foo { } impl ::std::cmp::PartialEq for Foo { fn eq(&self, other: &Foo) -> bool { - &self.large[..] == &other.large[..] - && self.type__bindgen_bitfield() == other.type__bindgen_bitfield() + &self.large[..] == &other.large[..] && + self.type__bindgen_bitfield() == other.type__bindgen_bitfield() } } impl Foo { #[inline] pub fn type__bindgen_bitfield(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) + } } #[inline] pub fn set_type__bindgen_bitfield(&mut self, val: ::std::os::raw::c_char) { @@ -174,8 +186,10 @@ impl Foo { pub fn new_bitfield_1( type__bindgen_bitfield: ::std::os::raw::c_char, ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { let type__bindgen_bitfield: u8 = unsafe { ::std::mem::transmute(type__bindgen_bitfield) }; diff --git a/tests/expectations/tests/derive-clone.rs b/tests/expectations/tests/derive-clone.rs index 62042ffc..3d19fda1 100644 --- a/tests/expectations/tests/derive-clone.rs +++ b/tests/expectations/tests/derive-clone.rs @@ -26,7 +26,10 @@ fn bindgen_test_layout_ShouldDeriveClone() { concat!("Alignment of ", stringify!(ShouldDeriveClone)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldDeriveClone>())).large as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldDeriveClone>())).large as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-clone_1_0.rs b/tests/expectations/tests/derive-clone_1_0.rs index c2fafe8f..7fd60b1a 100644 --- a/tests/expectations/tests/derive-clone_1_0.rs +++ b/tests/expectations/tests/derive-clone_1_0.rs @@ -27,7 +27,10 @@ fn bindgen_test_layout_ShouldImplClone() { concat!("Alignment of ", stringify!(ShouldImplClone)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldImplClone>())).large as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldImplClone>())).large as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-debug-bitfield-core.rs b/tests/expectations/tests/derive-debug-bitfield-core.rs index 882bb9d6..b0a006e6 100644 --- a/tests/expectations/tests/derive-debug-bitfield-core.rs +++ b/tests/expectations/tests/derive-debug-bitfield-core.rs @@ -59,7 +59,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -77,7 +80,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -109,7 +115,9 @@ fn bindgen_test_layout_C() { concat!("Alignment of ", stringify!(C)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<C>())).large_array as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<C>())).large_array as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -137,7 +145,9 @@ impl ::core::fmt::Debug for C { impl C { #[inline] pub fn a(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_a(&mut self, val: bool) { @@ -148,7 +158,9 @@ impl C { } #[inline] pub fn b(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + unsafe { + ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) + } } #[inline] pub fn set_b(&mut self, val: bool) { @@ -158,9 +170,14 @@ impl C { } } #[inline] - pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + a: bool, + b: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u8 = unsafe { ::core::mem::transmute(a) }; a as u64 diff --git a/tests/expectations/tests/derive-debug-bitfield.rs b/tests/expectations/tests/derive-debug-bitfield.rs index d72dd987..94582448 100644 --- a/tests/expectations/tests/derive-debug-bitfield.rs +++ b/tests/expectations/tests/derive-debug-bitfield.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -107,7 +113,9 @@ fn bindgen_test_layout_C() { concat!("Alignment of ", stringify!(C)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).large_array as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).large_array as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -132,7 +140,11 @@ impl ::std::fmt::Debug for C { self.large_array .iter() .enumerate() - .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v)) + .map(|(i, v)| format!( + "{}{:?}", + if i > 0 { ", " } else { "" }, + v + )) .collect::<String>() ) } @@ -140,7 +152,9 @@ impl ::std::fmt::Debug for C { impl C { #[inline] pub fn a(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_a(&mut self, val: bool) { @@ -151,7 +165,9 @@ impl C { } #[inline] pub fn b(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) + } } #[inline] pub fn set_b(&mut self, val: bool) { @@ -161,9 +177,14 @@ impl C { } } #[inline] - pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + a: bool, + b: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u8 = unsafe { ::std::mem::transmute(a) }; a as u64 diff --git a/tests/expectations/tests/derive-debug-function-pointer.rs b/tests/expectations/tests/derive-debug-function-pointer.rs index 237fa1d4..7915fb66 100644 --- a/tests/expectations/tests/derive-debug-function-pointer.rs +++ b/tests/expectations/tests/derive-debug-function-pointer.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Copy, Clone)] @@ -10,7 +13,8 @@ pub struct Nice { pub pointer: Nice_Function, pub large_array: [::std::os::raw::c_int; 34usize], } -pub type Nice_Function = ::std::option::Option<unsafe extern "C" fn(data: ::std::os::raw::c_int)>; +pub type Nice_Function = + ::std::option::Option<unsafe extern "C" fn(data: ::std::os::raw::c_int)>; #[test] fn bindgen_test_layout_Nice() { assert_eq!( @@ -24,7 +28,9 @@ fn bindgen_test_layout_Nice() { concat!("Alignment of ", stringify!(Nice)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Nice>())).pointer as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Nice>())).pointer as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -34,7 +40,9 @@ fn bindgen_test_layout_Nice() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Nice>())).large_array as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Nice>())).large_array as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -58,7 +66,11 @@ impl ::std::fmt::Debug for Nice { self.large_array .iter() .enumerate() - .map(|(i, v)| format!("{}{:?}", if i > 0 { ", " } else { "" }, v)) + .map(|(i, v)| format!( + "{}{:?}", + if i > 0 { ", " } else { "" }, + v + )) .collect::<String>() ) } diff --git a/tests/expectations/tests/derive-debug-generic.rs b/tests/expectations/tests/derive-debug-generic.rs index c793cb8a..40cc99a5 100644 --- a/tests/expectations/tests/derive-debug-generic.rs +++ b/tests/expectations/tests/derive-debug-generic.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct Generic<T> { diff --git a/tests/expectations/tests/derive-debug-mangle-name.rs b/tests/expectations/tests/derive-debug-mangle-name.rs index 9c72fbbd..e9ea16e4 100644 --- a/tests/expectations/tests/derive-debug-mangle-name.rs +++ b/tests/expectations/tests/derive-debug-mangle-name.rs @@ -34,7 +34,10 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<perf_event_attr__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<perf_event_attr__bindgen_ty_1>())).b + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -44,7 +47,10 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<perf_event_attr__bindgen_ty_1>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<perf_event_attr__bindgen_ty_1>())).c + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -77,7 +83,10 @@ fn bindgen_test_layout_perf_event_attr() { concat!("Alignment of ", stringify!(perf_event_attr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<perf_event_attr>())).type_ as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<perf_event_attr>())).type_ as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -87,7 +96,9 @@ fn bindgen_test_layout_perf_event_attr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<perf_event_attr>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<perf_event_attr>())).a as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs b/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs index 605ce78f..d00b65ef 100644 --- a/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs +++ b/tests/expectations/tests/derive-debug-opaque-template-instantiation.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct Instance { @@ -21,7 +24,9 @@ fn bindgen_test_layout_Instance() { concat!("Alignment of ", stringify!(Instance)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Instance>())).val as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Instance>())).val as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-debug-opaque.rs b/tests/expectations/tests/derive-debug-opaque.rs index bc7d9fd6..a1747fcc 100644 --- a/tests/expectations/tests/derive-debug-opaque.rs +++ b/tests/expectations/tests/derive-debug-opaque.rs @@ -52,7 +52,9 @@ fn bindgen_test_layout_OpaqueUser() { concat!("Alignment of ", stringify!(OpaqueUser)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<OpaqueUser>())).opaque as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<OpaqueUser>())).opaque as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-default-and-blacklist.rs b/tests/expectations/tests/derive-default-and-blacklist.rs index 1520aa3c..0087dd50 100644 --- a/tests/expectations/tests/derive-default-and-blacklist.rs +++ b/tests/expectations/tests/derive-default-and-blacklist.rs @@ -28,7 +28,10 @@ fn bindgen_test_layout_ShouldNotDeriveDefault() { concat!("Alignment of ", stringify!(ShouldNotDeriveDefault)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotDeriveDefault>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotDeriveDefault>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-fn-ptr.rs b/tests/expectations/tests/derive-fn-ptr.rs index 7f158b3b..6ea28a02 100644 --- a/tests/expectations/tests/derive-fn-ptr.rs +++ b/tests/expectations/tests/derive-fn-ptr.rs @@ -45,7 +45,9 @@ fn bindgen_test_layout_Foo() { concat!("Alignment of ", stringify!(Foo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Foo>())).callback as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Foo>())).callback as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +91,9 @@ fn bindgen_test_layout_Bar() { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).callback as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).callback as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-hash-and-blacklist.rs b/tests/expectations/tests/derive-hash-and-blacklist.rs index 92e918ca..51a792f1 100644 --- a/tests/expectations/tests/derive-hash-and-blacklist.rs +++ b/tests/expectations/tests/derive-hash-and-blacklist.rs @@ -27,7 +27,10 @@ fn bindgen_test_layout_ShouldNotDeriveHash() { concat!("Alignment of ", stringify!(ShouldNotDeriveHash)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotDeriveHash>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotDeriveHash>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-hash-blacklisting.rs b/tests/expectations/tests/derive-hash-blacklisting.rs index f64db062..8b696e92 100644 --- a/tests/expectations/tests/derive-hash-blacklisting.rs +++ b/tests/expectations/tests/derive-hash-blacklisting.rs @@ -33,7 +33,9 @@ fn bindgen_test_layout_WhitelistedOne() { concat!("Alignment of ", stringify!(WhitelistedOne)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WhitelistedOne>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WhitelistedOne>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -66,7 +68,9 @@ fn bindgen_test_layout_WhitelistedTwo() { concat!("Alignment of ", stringify!(WhitelistedTwo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WhitelistedTwo>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WhitelistedTwo>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", 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 c3159532..3e0693b8 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 @@ -32,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs b/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs index a38fd27d..d2e60d27 100644 --- a/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs +++ b/tests/expectations/tests/derive-hash-struct-with-incomplete-array.rs @@ -67,7 +67,10 @@ fn bindgen_test_layout_test() { concat!("Offset of field: ", stringify!(test), "::", stringify!(a)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<test>())).zero_length_array as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<test>())).zero_length_array as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-hash-struct-with-pointer.rs b/tests/expectations/tests/derive-hash-struct-with-pointer.rs index c0b14b02..28d3105e 100644 --- a/tests/expectations/tests/derive-hash-struct-with-pointer.rs +++ b/tests/expectations/tests/derive-hash-struct-with-pointer.rs @@ -26,7 +26,9 @@ fn bindgen_test_layout_ConstPtrMutObj() { concat!("Alignment of ", stringify!(ConstPtrMutObj)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ConstPtrMutObj>())).bar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ConstPtrMutObj>())).bar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -59,7 +61,9 @@ fn bindgen_test_layout_MutPtrMutObj() { concat!("Alignment of ", stringify!(MutPtrMutObj)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<MutPtrMutObj>())).bar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<MutPtrMutObj>())).bar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -92,7 +96,9 @@ fn bindgen_test_layout_MutPtrConstObj() { concat!("Alignment of ", stringify!(MutPtrConstObj)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<MutPtrConstObj>())).bar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<MutPtrConstObj>())).bar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -125,7 +131,10 @@ fn bindgen_test_layout_ConstPtrConstObj() { concat!("Alignment of ", stringify!(ConstPtrConstObj)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ConstPtrConstObj>())).bar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ConstPtrConstObj>())).bar as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-partialeq-and-blacklist.rs b/tests/expectations/tests/derive-partialeq-and-blacklist.rs index 01fdc079..2026e5ad 100644 --- a/tests/expectations/tests/derive-partialeq-and-blacklist.rs +++ b/tests/expectations/tests/derive-partialeq-and-blacklist.rs @@ -28,7 +28,10 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { concat!("Alignment of ", stringify!(ShouldNotDerivePartialEq)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-partialeq-base.rs b/tests/expectations/tests/derive-partialeq-base.rs index ed92813b..b6c38c0f 100644 --- a/tests/expectations/tests/derive-partialeq-base.rs +++ b/tests/expectations/tests/derive-partialeq-base.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Copy, Clone)] diff --git a/tests/expectations/tests/derive-partialeq-bitfield.rs b/tests/expectations/tests/derive-partialeq-bitfield.rs index c183fc0f..808afc05 100644 --- a/tests/expectations/tests/derive-partialeq-bitfield.rs +++ b/tests/expectations/tests/derive-partialeq-bitfield.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -107,7 +113,9 @@ fn bindgen_test_layout_C() { concat!("Alignment of ", stringify!(C)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).large_array as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).large_array as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -124,15 +132,17 @@ impl Default for C { } impl ::std::cmp::PartialEq for C { fn eq(&self, other: &C) -> bool { - self.a() == other.a() - && self.b() == other.b() - && &self.large_array[..] == &other.large_array[..] + self.a() == other.a() && + self.b() == other.b() && + &self.large_array[..] == &other.large_array[..] } } impl C { #[inline] pub fn a(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_a(&mut self, val: bool) { @@ -143,7 +153,9 @@ impl C { } #[inline] pub fn b(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) + } } #[inline] pub fn set_b(&mut self, val: bool) { @@ -153,9 +165,14 @@ impl C { } } #[inline] - pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + a: bool, + b: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u8 = unsafe { ::std::mem::transmute(a) }; a as u64 diff --git a/tests/expectations/tests/derive-partialeq-core.rs b/tests/expectations/tests/derive-partialeq-core.rs index 7d6f3571..8cf4b4a1 100644 --- a/tests/expectations/tests/derive-partialeq-core.rs +++ b/tests/expectations/tests/derive-partialeq-core.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern crate core; @@ -23,7 +27,9 @@ fn bindgen_test_layout_C() { concat!("Alignment of ", stringify!(C)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<C>())).large_array as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<C>())).large_array as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-partialeq-union.rs b/tests/expectations/tests/derive-partialeq-union.rs index a271f410..f91ce124 100644 --- a/tests/expectations/tests/derive-partialeq-union.rs +++ b/tests/expectations/tests/derive-partialeq-union.rs @@ -28,7 +28,10 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { concat!("Alignment of ", stringify!(ShouldNotDerivePartialEq)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +41,10 @@ fn bindgen_test_layout_ShouldNotDerivePartialEq() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotDerivePartialEq>())).b as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/derive-partialeq-union_1_0.rs b/tests/expectations/tests/derive-partialeq-union_1_0.rs index 41a42dd7..7739088c 100644 --- a/tests/expectations/tests/derive-partialeq-union_1_0.rs +++ b/tests/expectations/tests/derive-partialeq-union_1_0.rs @@ -71,7 +71,10 @@ fn bindgen_test_layout_ShouldDerivePartialEq() { concat!("Alignment of ", stringify!(ShouldDerivePartialEq)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldDerivePartialEq>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldDerivePartialEq>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -81,7 +84,10 @@ fn bindgen_test_layout_ShouldDerivePartialEq() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldDerivePartialEq>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldDerivePartialEq>())).b as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/disable-namespacing.rs b/tests/expectations/tests/disable-namespacing.rs index b369a22d..0ef47c0e 100644 --- a/tests/expectations/tests/disable-namespacing.rs +++ b/tests/expectations/tests/disable-namespacing.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type Baz = ::std::os::raw::c_int; diff --git a/tests/expectations/tests/divide-by-zero-in-struct-layout.rs b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs index fcfa962b..77ccce3d 100644 --- a/tests/expectations/tests/divide-by-zero-in-struct-layout.rs +++ b/tests/expectations/tests/divide-by-zero-in-struct-layout.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -98,8 +104,10 @@ pub struct WithBitfield { impl WithBitfield { #[inline] pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 0usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 0usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 0usize], + u8, + > = Default::default(); __bindgen_bitfield_unit } } @@ -113,8 +121,10 @@ pub struct WithBitfieldAndAttrPacked { impl WithBitfieldAndAttrPacked { #[inline] pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 0usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 0usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 0usize], + u8, + > = Default::default(); __bindgen_bitfield_unit } } @@ -128,8 +138,10 @@ pub struct WithBitfieldAndPacked { impl WithBitfieldAndPacked { #[inline] pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 0usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 0usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 0usize], + u8, + > = Default::default(); __bindgen_bitfield_unit } } diff --git a/tests/expectations/tests/do-not-derive-copy.rs b/tests/expectations/tests/do-not-derive-copy.rs index 50fcebd4..c7a384d0 100644 --- a/tests/expectations/tests/do-not-derive-copy.rs +++ b/tests/expectations/tests/do-not-derive-copy.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] @@ -26,7 +29,8 @@ fn bindgen_test_layout_WouldBeCopyButWeAreNotDerivingCopy() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<WouldBeCopyButWeAreNotDerivingCopy>())).x as *const _ as usize + &(*(::std::ptr::null::<WouldBeCopyButWeAreNotDerivingCopy>())).x + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/duplicated-namespaces-definitions.rs b/tests/expectations/tests/duplicated-namespaces-definitions.rs index fff400c2..8a377151 100644 --- a/tests/expectations/tests/duplicated-namespaces-definitions.rs +++ b/tests/expectations/tests/duplicated-namespaces-definitions.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -30,14 +33,28 @@ pub mod root { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(foo)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(foo) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).baz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).baz as *const _ as usize + }, 4usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(baz) + ) ); } } @@ -62,9 +79,16 @@ pub mod root { concat!("Alignment of ", stringify!(Foo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Foo>())).ptr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Foo>())).ptr as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Foo), "::", stringify!(ptr)) + concat!( + "Offset of field: ", + stringify!(Foo), + "::", + stringify!(ptr) + ) ); } impl Default for Foo { diff --git a/tests/expectations/tests/duplicated-namespaces.rs b/tests/expectations/tests/duplicated-namespaces.rs index a5f2caac..d44dac5d 100644 --- a/tests/expectations/tests/duplicated-namespaces.rs +++ b/tests/expectations/tests/duplicated-namespaces.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/duplicated_constants_in_ns.rs b/tests/expectations/tests/duplicated_constants_in_ns.rs index c3f1adde..f616eaad 100644 --- a/tests/expectations/tests/duplicated_constants_in_ns.rs +++ b/tests/expectations/tests/duplicated_constants_in_ns.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/elaborated.rs b/tests/expectations/tests/elaborated.rs index f68b55af..def5e7c4 100644 --- a/tests/expectations/tests/elaborated.rs +++ b/tests/expectations/tests/elaborated.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type whatever_whatever_t = ::std::os::raw::c_int; extern "C" { diff --git a/tests/expectations/tests/empty-enum.rs b/tests/expectations/tests/empty-enum.rs index 473a508a..06f24422 100644 --- a/tests/expectations/tests/empty-enum.rs +++ b/tests/expectations/tests/empty-enum.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type EmptyConstified = u32; #[repr(u32)] diff --git a/tests/expectations/tests/empty_template_param_name.rs b/tests/expectations/tests/empty_template_param_name.rs index 30289ce4..b80a983b 100644 --- a/tests/expectations/tests/empty_template_param_name.rs +++ b/tests/expectations/tests/empty_template_param_name.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type __void_t = ::std::os::raw::c_void; #[repr(C)] diff --git a/tests/expectations/tests/enum-default-consts.rs b/tests/expectations/tests/enum-default-consts.rs index 6ced4de0..c2ef6502 100644 --- a/tests/expectations/tests/enum-default-consts.rs +++ b/tests/expectations/tests/enum-default-consts.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const Foo_Bar: Foo = 0; pub const Foo_Qux: Foo = 1; diff --git a/tests/expectations/tests/enum-default-module.rs b/tests/expectations/tests/enum-default-module.rs index 953793c3..1ed4338f 100644 --- a/tests/expectations/tests/enum-default-module.rs +++ b/tests/expectations/tests/enum-default-module.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod Foo { pub type Type = u32; diff --git a/tests/expectations/tests/enum-default-rust.rs b/tests/expectations/tests/enum-default-rust.rs index 1400e373..6c658324 100644 --- a/tests/expectations/tests/enum-default-rust.rs +++ b/tests/expectations/tests/enum-default-rust.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/enum-undefault.rs b/tests/expectations/tests/enum-undefault.rs index b5d56c42..11d41622 100644 --- a/tests/expectations/tests/enum-undefault.rs +++ b/tests/expectations/tests/enum-undefault.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/enum_alias.rs b/tests/expectations/tests/enum_alias.rs index 30a4f62a..29961779 100644 --- a/tests/expectations/tests/enum_alias.rs +++ b/tests/expectations/tests/enum_alias.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/tests/expectations/tests/enum_and_vtable_mangling.rs index 76e28aaf..8d2cf204 100644 --- a/tests/expectations/tests/enum_and_vtable_mangling.rs +++ b/tests/expectations/tests/enum_and_vtable_mangling.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const match_: _bindgen_ty_1 = _bindgen_ty_1::match_; pub const whatever_else: _bindgen_ty_1 = _bindgen_ty_1::whatever_else; diff --git a/tests/expectations/tests/enum_explicit_type.rs b/tests/expectations/tests/enum_explicit_type.rs index a5ec4a57..fee19153 100644 --- a/tests/expectations/tests/enum_explicit_type.rs +++ b/tests/expectations/tests/enum_explicit_type.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/enum_explicit_type_constants.rs b/tests/expectations/tests/enum_explicit_type_constants.rs index cd1a9229..c15849f3 100644 --- a/tests/expectations/tests/enum_explicit_type_constants.rs +++ b/tests/expectations/tests/enum_explicit_type_constants.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const Foo_Bar: Foo = 0; pub const Foo_Qux: Foo = 1; diff --git a/tests/expectations/tests/enum_negative.rs b/tests/expectations/tests/enum_negative.rs index e066968d..4824c5d5 100644 --- a/tests/expectations/tests/enum_negative.rs +++ b/tests/expectations/tests/enum_negative.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/enum_packed.rs b/tests/expectations/tests/enum_packed.rs index d388b5ed..a1514ab2 100644 --- a/tests/expectations/tests/enum_packed.rs +++ b/tests/expectations/tests/enum_packed.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/eval-variadic-template-parameter.rs b/tests/expectations/tests/eval-variadic-template-parameter.rs index 1386396f..8f6f8981 100644 --- a/tests/expectations/tests/eval-variadic-template-parameter.rs +++ b/tests/expectations/tests/eval-variadic-template-parameter.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/extern-const-struct.rs b/tests/expectations/tests/extern-const-struct.rs index df81311b..51e9f970 100644 --- a/tests/expectations/tests/extern-const-struct.rs +++ b/tests/expectations/tests/extern-const-struct.rs @@ -25,7 +25,9 @@ fn bindgen_test_layout_nsFoo() { concat!("Alignment of ", stringify!(nsFoo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsFoo>())).details as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsFoo>())).details as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/extern.rs b/tests/expectations/tests/extern.rs index e257b7bc..af01e955 100644 --- a/tests/expectations/tests/extern.rs +++ b/tests/expectations/tests/extern.rs @@ -1,10 +1,12 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type foo = ::std::option::Option< - unsafe extern "C" fn(bar: ::std::os::raw::c_int) - -> ::std::os::raw::c_int, + unsafe extern "C" fn(bar: ::std::os::raw::c_int) -> ::std::os::raw::c_int, >; diff --git a/tests/expectations/tests/float128.rs b/tests/expectations/tests/float128.rs index 5dcc6c40..d6776794 100644 --- a/tests/expectations/tests/float128.rs +++ b/tests/expectations/tests/float128.rs @@ -1,4 +1,8 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs index 5d3c3eaa..8501ce97 100644 --- a/tests/expectations/tests/forward-declaration-autoptr.rs +++ b/tests/expectations/tests/forward-declaration-autoptr.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -36,7 +41,9 @@ fn bindgen_test_layout_Bar() { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).m_member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).m_member as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/forward-enum-decl.rs b/tests/expectations/tests/forward-enum-decl.rs index d327cb72..90666f4b 100644 --- a/tests/expectations/tests/forward-enum-decl.rs +++ b/tests/expectations/tests/forward-enum-decl.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/forward-inherit-struct-with-fields.rs b/tests/expectations/tests/forward-inherit-struct-with-fields.rs index 19772dbe..01358964 100644 --- a/tests/expectations/tests/forward-inherit-struct-with-fields.rs +++ b/tests/expectations/tests/forward-inherit-struct-with-fields.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/forward-inherit-struct.rs b/tests/expectations/tests/forward-inherit-struct.rs index a2399bcb..e39c8669 100644 --- a/tests/expectations/tests/forward-inherit-struct.rs +++ b/tests/expectations/tests/forward-inherit-struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/forward_declared_complex_types.rs b/tests/expectations/tests/forward_declared_complex_types.rs index 1132bfbe..3175b8a9 100644 --- a/tests/expectations/tests/forward_declared_complex_types.rs +++ b/tests/expectations/tests/forward_declared_complex_types.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/forward_declared_struct.rs b/tests/expectations/tests/forward_declared_struct.rs index c69960b8..a5954226 100644 --- a/tests/expectations/tests/forward_declared_struct.rs +++ b/tests/expectations/tests/forward_declared_struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/func_proto.rs b/tests/expectations/tests/func_proto.rs index e257b7bc..af01e955 100644 --- a/tests/expectations/tests/func_proto.rs +++ b/tests/expectations/tests/func_proto.rs @@ -1,10 +1,12 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type foo = ::std::option::Option< - unsafe extern "C" fn(bar: ::std::os::raw::c_int) - -> ::std::os::raw::c_int, + unsafe extern "C" fn(bar: ::std::os::raw::c_int) -> ::std::os::raw::c_int, >; diff --git a/tests/expectations/tests/func_ptr.rs b/tests/expectations/tests/func_ptr.rs index 0f39a075..ce89a2e6 100644 --- a/tests/expectations/tests/func_ptr.rs +++ b/tests/expectations/tests/func_ptr.rs @@ -1,13 +1,17 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { - pub static mut foo: - ::std::option::Option< - unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) - -> ::std::os::raw::c_int, + pub static mut foo: ::std::option::Option< + unsafe extern "C" fn( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, >; } diff --git a/tests/expectations/tests/func_ptr_in_struct.rs b/tests/expectations/tests/func_ptr_in_struct.rs index f23984e8..60b8029d 100644 --- a/tests/expectations/tests/func_ptr_in_struct.rs +++ b/tests/expectations/tests/func_ptr_in_struct.rs @@ -16,7 +16,10 @@ pub enum baz { #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Foo { pub bar: ::std::option::Option< - unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> baz, + unsafe extern "C" fn( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> baz, >, } #[test] diff --git a/tests/expectations/tests/func_ptr_return_type.rs b/tests/expectations/tests/func_ptr_return_type.rs index 3a2c9001..0ce7809c 100644 --- a/tests/expectations/tests/func_ptr_return_type.rs +++ b/tests/expectations/tests/func_ptr_return_type.rs @@ -15,4 +15,3 @@ extern "C" { ) -> ::std::os::raw::c_int, >; } - diff --git a/tests/expectations/tests/func_with_array_arg.rs b/tests/expectations/tests/func_with_array_arg.rs index ec5617dc..e03cb82e 100644 --- a/tests/expectations/tests/func_with_array_arg.rs +++ b/tests/expectations/tests/func_with_array_arg.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn f(x: *mut ::std::os::raw::c_int); diff --git a/tests/expectations/tests/func_with_func_ptr_arg.rs b/tests/expectations/tests/func_with_func_ptr_arg.rs index 3cb82102..8d94b715 100644 --- a/tests/expectations/tests/func_with_func_ptr_arg.rs +++ b/tests/expectations/tests/func_with_func_ptr_arg.rs @@ -13,10 +13,16 @@ extern "C" { extern "C" { pub fn bar( one: ::std::option::Option< - unsafe extern "C" fn(a: ::std::os::raw::c_int, b: ::std::os::raw::c_int), + unsafe extern "C" fn( + a: ::std::os::raw::c_int, + b: ::std::os::raw::c_int, + ), >, two: ::std::option::Option< - unsafe extern "C" fn(c: ::std::os::raw::c_int, d: ::std::os::raw::c_int), + unsafe extern "C" fn( + c: ::std::os::raw::c_int, + d: ::std::os::raw::c_int, + ), >, ); } diff --git a/tests/expectations/tests/gen-constructors-neg.rs b/tests/expectations/tests/gen-constructors-neg.rs index 36cae722..f14057bf 100644 --- a/tests/expectations/tests/gen-constructors-neg.rs +++ b/tests/expectations/tests/gen-constructors-neg.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/gen-constructors.rs b/tests/expectations/tests/gen-constructors.rs index cb2024a1..4f948450 100644 --- a/tests/expectations/tests/gen-constructors.rs +++ b/tests/expectations/tests/gen-constructors.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/gen-destructors-neg.rs b/tests/expectations/tests/gen-destructors-neg.rs index 37740e09..552ad41e 100644 --- a/tests/expectations/tests/gen-destructors-neg.rs +++ b/tests/expectations/tests/gen-destructors-neg.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] diff --git a/tests/expectations/tests/gen-destructors.rs b/tests/expectations/tests/gen-destructors.rs index 03ccec2a..1715a9d1 100644 --- a/tests/expectations/tests/gen-destructors.rs +++ b/tests/expectations/tests/gen-destructors.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] diff --git a/tests/expectations/tests/generate-inline.rs b/tests/expectations/tests/generate-inline.rs index 48d8f4f8..4276a3ef 100644 --- a/tests/expectations/tests/generate-inline.rs +++ b/tests/expectations/tests/generate-inline.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/i128.rs b/tests/expectations/tests/i128.rs index 1fae2bee..0d926260 100644 --- a/tests/expectations/tests/i128.rs +++ b/tests/expectations/tests/i128.rs @@ -27,7 +27,9 @@ fn bindgen_test_layout_foo() { concat!("Alignment of ", stringify!(foo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo>())).my_signed as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo>())).my_signed as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -37,7 +39,9 @@ fn bindgen_test_layout_foo() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo>())).my_unsigned as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo>())).my_unsigned as *const _ as usize + }, 16usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/in_class_typedef.rs b/tests/expectations/tests/in_class_typedef.rs index 92a23ad3..5fb517f3 100644 --- a/tests/expectations/tests/in_class_typedef.rs +++ b/tests/expectations/tests/in_class_typedef.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/incomplete-array-padding.rs b/tests/expectations/tests/incomplete-array-padding.rs index 5e96bbce..b83a6dcb 100644 --- a/tests/expectations/tests/incomplete-array-padding.rs +++ b/tests/expectations/tests/incomplete-array-padding.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -151,7 +157,9 @@ impl Default for foo { impl foo { #[inline] pub fn a(&self) -> ::std::os::raw::c_char { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_a(&mut self, val: ::std::os::raw::c_char) { @@ -161,9 +169,13 @@ impl foo { } } #[inline] - pub fn new_bitfield_1(a: ::std::os::raw::c_char) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + a: ::std::os::raw::c_char, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u8 = unsafe { ::std::mem::transmute(a) }; a as u64 diff --git a/tests/expectations/tests/infinite-macro.rs b/tests/expectations/tests/infinite-macro.rs index 7c88ce2a..b1a66463 100644 --- a/tests/expectations/tests/infinite-macro.rs +++ b/tests/expectations/tests/infinite-macro.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const INFINITY: f64 = ::std::f64::INFINITY; pub const NAN: f64 = ::std::f64::NAN; diff --git a/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs b/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs index 19200ac1..6e118d68 100644 --- a/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs +++ b/tests/expectations/tests/inherit-from-template-instantiation-with-vtable.rs @@ -153,7 +153,8 @@ fn __bindgen_test_layout_BaseWithVtable_open0_ptr_char_close0_instantiation() { ); } #[test] -fn __bindgen_test_layout_BaseWithVtable_open0_ptr_char_close0_instantiation_1() { +fn __bindgen_test_layout_BaseWithVtable_open0_ptr_char_close0_instantiation_1() +{ assert_eq!( ::std::mem::size_of::<BaseWithVtable<*mut ::std::os::raw::c_char>>(), 16usize, @@ -172,7 +173,8 @@ fn __bindgen_test_layout_BaseWithVtable_open0_ptr_char_close0_instantiation_1() ); } #[test] -fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation() { +fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation() +{ assert_eq!( ::std::mem::size_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>(), 8usize, @@ -182,7 +184,8 @@ fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation() ) ); assert_eq!( - ::std::mem::align_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>(), + ::std::mem::align_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>( + ), 8usize, concat!( "Alignment of template specialization: ", @@ -191,7 +194,8 @@ fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation() ); } #[test] -fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation_1() { +fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation_1( +) { assert_eq!( ::std::mem::size_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>(), 8usize, @@ -201,7 +205,8 @@ fn __bindgen_test_layout_BaseWithoutVtable_open0_ptr_char_close0_instantiation_1 ) ); assert_eq!( - ::std::mem::align_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>(), + ::std::mem::align_of::<BaseWithoutVtable<*mut ::std::os::raw::c_char>>( + ), 8usize, concat!( "Alignment of template specialization: ", diff --git a/tests/expectations/tests/inherit-namespaced.rs b/tests/expectations/tests/inherit-namespaced.rs index a2399bcb..e39c8669 100644 --- a/tests/expectations/tests/inherit-namespaced.rs +++ b/tests/expectations/tests/inherit-namespaced.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/inherit_named.rs b/tests/expectations/tests/inherit_named.rs index fadf270e..7c7f729f 100644 --- a/tests/expectations/tests/inherit_named.rs +++ b/tests/expectations/tests/inherit_named.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/inherit_typedef.rs b/tests/expectations/tests/inherit_typedef.rs index 49e842d7..13eac16b 100644 --- a/tests/expectations/tests/inherit_typedef.rs +++ b/tests/expectations/tests/inherit_typedef.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/inline-function.rs b/tests/expectations/tests/inline-function.rs index 5dcc6c40..d6776794 100644 --- a/tests/expectations/tests/inline-function.rs +++ b/tests/expectations/tests/inline-function.rs @@ -1,4 +1,8 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] diff --git a/tests/expectations/tests/inline_namespace.rs b/tests/expectations/tests/inline_namespace.rs index 910883de..b6905c4d 100644 --- a/tests/expectations/tests/inline_namespace.rs +++ b/tests/expectations/tests/inline_namespace.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -33,7 +36,12 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<Bar>())).baz as *const _ as usize }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(baz) + ) ); } } diff --git a/tests/expectations/tests/inline_namespace_conservative.rs b/tests/expectations/tests/inline_namespace_conservative.rs index 90fc3793..bfd48385 100644 --- a/tests/expectations/tests/inline_namespace_conservative.rs +++ b/tests/expectations/tests/inline_namespace_conservative.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -38,7 +41,12 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<Bar>())).baz as *const _ as usize }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(baz) + ) ); } } diff --git a/tests/expectations/tests/inline_namespace_no_ns_enabled.rs b/tests/expectations/tests/inline_namespace_no_ns_enabled.rs index e208f0dc..ac2fa72a 100644 --- a/tests/expectations/tests/inline_namespace_no_ns_enabled.rs +++ b/tests/expectations/tests/inline_namespace_no_ns_enabled.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug)] diff --git a/tests/expectations/tests/inline_namespace_whitelist.rs b/tests/expectations/tests/inline_namespace_whitelist.rs index 857a7005..e4a471cf 100644 --- a/tests/expectations/tests/inline_namespace_whitelist.rs +++ b/tests/expectations/tests/inline_namespace_whitelist.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/inner_const.rs b/tests/expectations/tests/inner_const.rs index ef62414e..c2e79023 100644 --- a/tests/expectations/tests/inner_const.rs +++ b/tests/expectations/tests/inner_const.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/inner_template_self.rs b/tests/expectations/tests/inner_template_self.rs index 5a975175..91666c8a 100644 --- a/tests/expectations/tests/inner_template_self.rs +++ b/tests/expectations/tests/inner_template_self.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -33,7 +36,10 @@ fn bindgen_test_layout_InstantiateIt() { concat!("Alignment of ", stringify!(InstantiateIt)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<InstantiateIt>())).m_list as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<InstantiateIt>())).m_list as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/int128_t.rs b/tests/expectations/tests/int128_t.rs index 5dcc6c40..d6776794 100644 --- a/tests/expectations/tests/int128_t.rs +++ b/tests/expectations/tests/int128_t.rs @@ -1,4 +1,8 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] diff --git a/tests/expectations/tests/issue-1025-unknown-enum-repr.rs b/tests/expectations/tests/issue-1025-unknown-enum-repr.rs index 26510910..b8711727 100644 --- a/tests/expectations/tests/issue-1025-unknown-enum-repr.rs +++ b/tests/expectations/tests/issue-1025-unknown-enum-repr.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-1034.rs b/tests/expectations/tests/issue-1034.rs index 4db46afe..1433fab1 100644 --- a/tests/expectations/tests/issue-1034.rs +++ b/tests/expectations/tests/issue-1034.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,8 +116,10 @@ fn bindgen_test_layout_S2() { impl S2 { #[inline] pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit } } diff --git a/tests/expectations/tests/issue-1040.rs b/tests/expectations/tests/issue-1040.rs index 3271d0e8..cde27973 100644 --- a/tests/expectations/tests/issue-1040.rs +++ b/tests/expectations/tests/issue-1040.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const g_107: ::std::os::raw::c_ulonglong = 18446744073709551615; diff --git a/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs b/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs index eef609a2..5665b24e 100644 --- a/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs +++ b/tests/expectations/tests/issue-1076-unnamed-bitfield-alignment.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,8 +116,10 @@ fn bindgen_test_layout_S1() { impl S1 { #[inline] pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit } } diff --git a/tests/expectations/tests/issue-1113-template-references.rs b/tests/expectations/tests/issue-1113-template-references.rs index 3430f27d..54c80b3d 100644 --- a/tests/expectations/tests/issue-1113-template-references.rs +++ b/tests/expectations/tests/issue-1113-template-references.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-1118-using-forward-decl.rs b/tests/expectations/tests/issue-1118-using-forward-decl.rs index d72e08b9..580329a5 100644 --- a/tests/expectations/tests/issue-1118-using-forward-decl.rs +++ b/tests/expectations/tests/issue-1118-using-forward-decl.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type c = nsTArray; #[repr(C)] @@ -23,7 +26,9 @@ fn bindgen_test_layout_nsTArray_base() { concat!("Alignment of ", stringify!(nsTArray_base)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsTArray_base>())).d as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsTArray_base>())).d as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -66,7 +71,9 @@ fn bindgen_test_layout_nsIContent() { concat!("Alignment of ", stringify!(nsIContent)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsIContent>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsIContent>())).foo as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -102,7 +109,8 @@ fn __bindgen_test_layout_nsTArray_open0_ptr_nsIContent_close0_instantiation() { ); } #[test] -fn __bindgen_test_layout_nsTArray_open0_ptr_nsIContent_close0_instantiation_1() { +fn __bindgen_test_layout_nsTArray_open0_ptr_nsIContent_close0_instantiation_1() +{ assert_eq!( ::std::mem::size_of::<nsTArray>(), 8usize, diff --git a/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs b/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs index a3c5f4f6..1c1baa59 100644 --- a/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs +++ b/tests/expectations/tests/issue-1197-pure-virtual-stuff.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct Foo__bindgen_vtable(::std::os::raw::c_void); diff --git a/tests/expectations/tests/issue-1198-alias-rust-const-mod-bitfield-enum.rs b/tests/expectations/tests/issue-1198-alias-rust-const-mod-bitfield-enum.rs index ed53fdf9..888636a1 100644 --- a/tests/expectations/tests/issue-1198-alias-rust-const-mod-bitfield-enum.rs +++ b/tests/expectations/tests/issue-1198-alias-rust-const-mod-bitfield-enum.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod MyDupeEnum { pub type Type = u32; diff --git a/tests/expectations/tests/issue-1198-alias-rust-const-mod-enum.rs b/tests/expectations/tests/issue-1198-alias-rust-const-mod-enum.rs index ed53fdf9..888636a1 100644 --- a/tests/expectations/tests/issue-1198-alias-rust-const-mod-enum.rs +++ b/tests/expectations/tests/issue-1198-alias-rust-const-mod-enum.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub mod MyDupeEnum { pub type Type = u32; diff --git a/tests/expectations/tests/issue-1238-fwd-no-copy.rs b/tests/expectations/tests/issue-1238-fwd-no-copy.rs index f2156dfb..061e39ea 100644 --- a/tests/expectations/tests/issue-1238-fwd-no-copy.rs +++ b/tests/expectations/tests/issue-1238-fwd-no-copy.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug)] diff --git a/tests/expectations/tests/issue-1281.rs b/tests/expectations/tests/issue-1281.rs index cfc8ca40..d56d6361 100644 --- a/tests/expectations/tests/issue-1281.rs +++ b/tests/expectations/tests/issue-1281.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-1285.rs b/tests/expectations/tests/issue-1285.rs index d0328d34..b630c54c 100644 --- a/tests/expectations/tests/issue-1285.rs +++ b/tests/expectations/tests/issue-1285.rs @@ -32,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-1291.rs b/tests/expectations/tests/issue-1291.rs index f92d364e..64166917 100644 --- a/tests/expectations/tests/issue-1291.rs +++ b/tests/expectations/tests/issue-1291.rs @@ -51,7 +51,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).align0 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).align0 as *const _ as usize + }, 12usize, concat!( "Offset of field: ", @@ -71,7 +73,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).align1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).align1 as *const _ as usize + }, 28usize, concat!( "Offset of field: ", @@ -81,7 +85,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).tnear as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).tnear as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -131,7 +137,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).align2 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).align2 as *const _ as usize + }, 60usize, concat!( "Offset of field: ", @@ -151,7 +159,9 @@ fn bindgen_test_layout_RTCRay() { concat!("Offset of field: ", stringify!(RTCRay), "::", stringify!(v)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).geomID as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).geomID as *const _ as usize + }, 72usize, concat!( "Offset of field: ", @@ -161,7 +171,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).primID as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).primID as *const _ as usize + }, 76usize, concat!( "Offset of field: ", @@ -171,7 +183,9 @@ fn bindgen_test_layout_RTCRay() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RTCRay>())).instID as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RTCRay>())).instID as *const _ as usize + }, 80usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-1498.rs b/tests/expectations/tests/issue-1498.rs index 0f9ef680..5dbf0bf5 100644 --- a/tests/expectations/tests/issue-1498.rs +++ b/tests/expectations/tests/issue-1498.rs @@ -46,7 +46,10 @@ fn bindgen_test_layout_rte_memseg__bindgen_ty_1() { concat!("Alignment of ", stringify!(rte_memseg__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg__bindgen_ty_1>())).addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg__bindgen_ty_1>())).addr + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -57,7 +60,8 @@ fn bindgen_test_layout_rte_memseg__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_memseg__bindgen_ty_1>())).addr_64 as *const _ as usize + &(*(::std::ptr::null::<rte_memseg__bindgen_ty_1>())).addr_64 + as *const _ as usize }, 0usize, concat!( @@ -86,7 +90,10 @@ fn bindgen_test_layout_rte_memseg() { concat!("Alignment of ", stringify!(rte_memseg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).phys_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).phys_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -96,7 +103,9 @@ fn bindgen_test_layout_rte_memseg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).len as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -106,7 +115,10 @@ fn bindgen_test_layout_rte_memseg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).hugepage_sz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).hugepage_sz as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -116,7 +128,10 @@ fn bindgen_test_layout_rte_memseg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).socket_id as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).socket_id as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -126,7 +141,9 @@ fn bindgen_test_layout_rte_memseg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).nchannel as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).nchannel as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -136,7 +153,9 @@ fn bindgen_test_layout_rte_memseg() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_memseg>())).nrank as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_memseg>())).nrank as *const _ as usize + }, 40usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-1554.rs b/tests/expectations/tests/issue-1554.rs index c3fb0d48..d3029979 100644 --- a/tests/expectations/tests/issue-1554.rs +++ b/tests/expectations/tests/issue-1554.rs @@ -9,7 +9,6 @@ #![cfg(feature = "nightly")] #![feature(non_exhaustive)] - #[repr(u32)] #[non_exhaustive] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/issue-358.rs b/tests/expectations/tests/issue-358.rs index 892148aa..19624c51 100644 --- a/tests/expectations/tests/issue-358.rs +++ b/tests/expectations/tests/issue-358.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-372.rs b/tests/expectations/tests/issue-372.rs index a146573b..ff9a7d04 100644 --- a/tests/expectations/tests/issue-372.rs +++ b/tests/expectations/tests/issue-372.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/issue-410.rs b/tests/expectations/tests/issue-410.rs index e1ce9df5..26ebcc3c 100644 --- a/tests/expectations/tests/issue-410.rs +++ b/tests/expectations/tests/issue-410.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/issue-446.rs b/tests/expectations/tests/issue-446.rs index d5634d53..e4f1b2a7 100644 --- a/tests/expectations/tests/issue-446.rs +++ b/tests/expectations/tests/issue-446.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-447.rs b/tests/expectations/tests/issue-447.rs index 11a99ad1..0d9eac80 100644 --- a/tests/expectations/tests/issue-447.rs +++ b/tests/expectations/tests/issue-447.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -61,7 +64,9 @@ pub mod root { } 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-537-repr-packed-n.rs b/tests/expectations/tests/issue-537-repr-packed-n.rs index 1c930a8b..6ec9a2d9 100644 --- a/tests/expectations/tests/issue-537-repr-packed-n.rs +++ b/tests/expectations/tests/issue-537-repr-packed-n.rs @@ -28,7 +28,9 @@ fn bindgen_test_layout_AlignedToOne() { concat!("Alignment of ", stringify!(AlignedToOne)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AlignedToOne>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AlignedToOne>())).i as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -57,7 +59,9 @@ fn bindgen_test_layout_AlignedToTwo() { concat!("Alignment of ", stringify!(AlignedToTwo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AlignedToTwo>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AlignedToTwo>())).i as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +93,9 @@ fn bindgen_test_layout_PackedToOne() { concat!("Alignment of ", stringify!(PackedToOne)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToOne>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToOne>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -99,7 +105,9 @@ fn bindgen_test_layout_PackedToOne() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToOne>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToOne>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -129,7 +137,9 @@ fn bindgen_test_layout_PackedToTwo() { concat!("Alignment of ", stringify!(PackedToTwo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToTwo>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToTwo>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -139,7 +149,9 @@ fn bindgen_test_layout_PackedToTwo() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToTwo>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToTwo>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-537.rs b/tests/expectations/tests/issue-537.rs index aaaa9f19..1081f7ab 100644 --- a/tests/expectations/tests/issue-537.rs +++ b/tests/expectations/tests/issue-537.rs @@ -27,7 +27,9 @@ fn bindgen_test_layout_AlignedToOne() { concat!("Alignment of ", stringify!(AlignedToOne)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AlignedToOne>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AlignedToOne>())).i as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -57,7 +59,9 @@ fn bindgen_test_layout_AlignedToTwo() { concat!("Alignment of ", stringify!(AlignedToTwo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AlignedToTwo>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AlignedToTwo>())).i as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +93,9 @@ fn bindgen_test_layout_PackedToOne() { concat!("Alignment of ", stringify!(PackedToOne)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToOne>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToOne>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -99,7 +105,9 @@ fn bindgen_test_layout_PackedToOne() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToOne>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToOne>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -131,7 +139,9 @@ fn bindgen_test_layout_PackedToTwo() { concat!("Alignment of ", stringify!(PackedToTwo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToTwo>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToTwo>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -141,7 +151,9 @@ fn bindgen_test_layout_PackedToTwo() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PackedToTwo>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PackedToTwo>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-544-stylo-creduce-2.rs b/tests/expectations/tests/issue-544-stylo-creduce-2.rs index 071111a4..8d708ad6 100644 --- a/tests/expectations/tests/issue-544-stylo-creduce-2.rs +++ b/tests/expectations/tests/issue-544-stylo-creduce-2.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct Foo { diff --git a/tests/expectations/tests/issue-544-stylo-creduce.rs b/tests/expectations/tests/issue-544-stylo-creduce.rs index fbee3b25..7c4cd7e1 100644 --- a/tests/expectations/tests/issue-544-stylo-creduce.rs +++ b/tests/expectations/tests/issue-544-stylo-creduce.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs b/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs index 1119b7e7..18ecc73e 100644 --- a/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs +++ b/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const ENUM_VARIANT_1: _bindgen_ty_1 = _bindgen_ty_1::ENUM_VARIANT_1; pub const ENUM_VARIANT_2: _bindgen_ty_1 = _bindgen_ty_1::ENUM_VARIANT_2; diff --git a/tests/expectations/tests/issue-573-layout-test-failures.rs b/tests/expectations/tests/issue-573-layout-test-failures.rs index cbb08bb2..0dfac518 100644 --- a/tests/expectations/tests/issue-573-layout-test-failures.rs +++ b/tests/expectations/tests/issue-573-layout-test-failures.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -27,7 +30,9 @@ fn bindgen_test_layout_AutoIdVector() { concat!("Alignment of ", stringify!(AutoIdVector)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<AutoIdVector>())).ar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<AutoIdVector>())).ar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs index 21d381a7..e1087f63 100644 --- a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs +++ b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -27,7 +30,9 @@ fn bindgen_test_layout__bindgen_ty_1() { concat!("Alignment of ", stringify!(_bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_bindgen_ty_1>())).ar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_bindgen_ty_1>())).ar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs index a7d085b0..42cb8659 100644 --- a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type RefPtr<T> = T; diff --git a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs index 11571a2d..0d846f4d 100644 --- a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-639-typedef-anon-field.rs b/tests/expectations/tests/issue-639-typedef-anon-field.rs index 3cc21b19..3494e1f1 100644 --- a/tests/expectations/tests/issue-639-typedef-anon-field.rs +++ b/tests/expectations/tests/issue-639-typedef-anon-field.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-643-inner-struct.rs b/tests/expectations/tests/issue-643-inner-struct.rs index e9384c07..167dab3d 100644 --- a/tests/expectations/tests/issue-643-inner-struct.rs +++ b/tests/expectations/tests/issue-643-inner-struct.rs @@ -69,7 +69,10 @@ fn bindgen_test_layout_rte_ring_prod() { concat!("Alignment of ", stringify!(rte_ring_prod)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ring_prod>())).watermark as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ring_prod>())).watermark as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -97,7 +100,10 @@ fn bindgen_test_layout_rte_ring_cons() { concat!("Alignment of ", stringify!(rte_ring_cons)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ring_cons>())).sc_dequeue as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ring_cons>())).sc_dequeue as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs index 4d65c0ae..e34d0425 100644 --- a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T); 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 15f02094..cb5ce74e 100644 --- a/tests/expectations/tests/issue-648-derive-debug-with-padding.rs +++ b/tests/expectations/tests/issue-648-derive-debug-with-padding.rs @@ -76,7 +76,10 @@ fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() { concat!("Alignment of ", stringify!(ShouldDeriveDebugButDoesNot)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldDeriveDebugButDoesNot>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldDeriveDebugButDoesNot>())).c + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -86,7 +89,10 @@ fn bindgen_test_layout_ShouldDeriveDebugButDoesNot() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldDeriveDebugButDoesNot>())).d as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldDeriveDebugButDoesNot>())).d + as *const _ as usize + }, 32usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-654-struct-fn-collision.rs b/tests/expectations/tests/issue-654-struct-fn-collision.rs index fbd8cca3..1f34e8ae 100644 --- a/tests/expectations/tests/issue-654-struct-fn-collision.rs +++ b/tests/expectations/tests/issue-654-struct-fn-collision.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs index f5ecbd5e..19e4ce3c 100644 --- a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs +++ b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/issue-662-part-2.rs b/tests/expectations/tests/issue-662-part-2.rs index 9e685b3a..7b790578 100644 --- a/tests/expectations/tests/issue-662-part-2.rs +++ b/tests/expectations/tests/issue-662-part-2.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T); diff --git a/tests/expectations/tests/issue-674-1.rs b/tests/expectations/tests/issue-674-1.rs index 01865494..cb76b776 100644 --- a/tests/expectations/tests/issue-674-1.rs +++ b/tests/expectations/tests/issue-674-1.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -36,7 +39,10 @@ pub mod root { concat!("Alignment of ", stringify!(CapturingContentInfo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<CapturingContentInfo>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<CapturingContentInfo>())).a as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-674-2.rs b/tests/expectations/tests/issue-674-2.rs index 9394708d..a6a37d9b 100644 --- a/tests/expectations/tests/issue-674-2.rs +++ b/tests/expectations/tests/issue-674-2.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/issue-674-3.rs b/tests/expectations/tests/issue-674-3.rs index 413ad926..c4b25649 100644 --- a/tests/expectations/tests/issue-674-3.rs +++ b/tests/expectations/tests/issue-674-3.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -55,7 +58,9 @@ pub mod root { concat!("Alignment of ", stringify!(nsCSSValue)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsCSSValue>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsCSSValue>())).c as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-677-nested-ns-specifier.rs b/tests/expectations/tests/issue-677-nested-ns-specifier.rs index c3fb0406..2f1b904f 100644 --- a/tests/expectations/tests/issue-677-nested-ns-specifier.rs +++ b/tests/expectations/tests/issue-677-nested-ns-specifier.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/issue-691-template-parameter-virtual.rs b/tests/expectations/tests/issue-691-template-parameter-virtual.rs index 4878c1fa..afe5b75d 100644 --- a/tests/expectations/tests/issue-691-template-parameter-virtual.rs +++ b/tests/expectations/tests/issue-691-template-parameter-virtual.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct VirtualMethods__bindgen_vtable(::std::os::raw::c_void); diff --git a/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs b/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs index 213b6812..48298a6f 100644 --- a/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs +++ b/tests/expectations/tests/issue-739-pointer-wide-bitfield.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,7 +116,9 @@ fn bindgen_test_layout_Foo() { impl Foo { #[inline] pub fn m_bitfield(&self) -> ::std::os::raw::c_ulong { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 64u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 64u8) as u64) + } } #[inline] pub fn set_m_bitfield(&mut self, val: ::std::os::raw::c_ulong) { @@ -121,7 +129,9 @@ impl Foo { } #[inline] pub fn m_bar(&self) -> ::std::os::raw::c_ulong { - unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 64u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(64usize, 64u8) as u64) + } } #[inline] pub fn set_m_bar(&mut self, val: ::std::os::raw::c_ulong) { @@ -132,7 +142,9 @@ impl Foo { } #[inline] pub fn foo(&self) -> ::std::os::raw::c_ulong { - unsafe { ::std::mem::transmute(self._bitfield_1.get(128usize, 1u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(128usize, 1u8) as u64) + } } #[inline] pub fn set_foo(&mut self, val: ::std::os::raw::c_ulong) { @@ -143,7 +155,9 @@ impl Foo { } #[inline] pub fn bar(&self) -> ::std::os::raw::c_ulong { - unsafe { ::std::mem::transmute(self._bitfield_1.get(192usize, 64u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(192usize, 64u8) as u64) + } } #[inline] pub fn set_bar(&mut self, val: ::std::os::raw::c_ulong) { @@ -159,8 +173,10 @@ impl Foo { foo: ::std::os::raw::c_ulong, bar: ::std::os::raw::c_ulong, ) -> __BindgenBitfieldUnit<[u8; 32usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 32usize], u64> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 32usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 64u8, { let m_bitfield: u64 = unsafe { ::std::mem::transmute(m_bitfield) }; m_bitfield as u64 diff --git a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs index 798a9f8f..1dee1aa1 100644 --- a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs +++ b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs @@ -122,7 +122,10 @@ fn bindgen_test_layout_Whitelisted() { concat!("Alignment of ", stringify!(Whitelisted)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Whitelisted>())).some_member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Whitelisted>())).some_member as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-816.rs b/tests/expectations/tests/issue-816.rs index e55bbb8c..82b1d676 100644 --- a/tests/expectations/tests/issue-816.rs +++ b/tests/expectations/tests/issue-816.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -110,7 +116,9 @@ fn bindgen_test_layout_capabilities() { impl capabilities { #[inline] pub fn bit_1(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) + } } #[inline] pub fn set_bit_1(&mut self, val: ::std::os::raw::c_uint) { @@ -121,7 +129,9 @@ impl capabilities { } #[inline] pub fn bit_2(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) + } } #[inline] pub fn set_bit_2(&mut self, val: ::std::os::raw::c_uint) { @@ -132,7 +142,9 @@ impl capabilities { } #[inline] pub fn bit_3(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) + } } #[inline] pub fn set_bit_3(&mut self, val: ::std::os::raw::c_uint) { @@ -143,7 +155,9 @@ impl capabilities { } #[inline] pub fn bit_4(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) + } } #[inline] pub fn set_bit_4(&mut self, val: ::std::os::raw::c_uint) { @@ -154,7 +168,9 @@ impl capabilities { } #[inline] pub fn bit_5(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) + } } #[inline] pub fn set_bit_5(&mut self, val: ::std::os::raw::c_uint) { @@ -165,7 +181,9 @@ impl capabilities { } #[inline] pub fn bit_6(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) + } } #[inline] pub fn set_bit_6(&mut self, val: ::std::os::raw::c_uint) { @@ -176,7 +194,9 @@ impl capabilities { } #[inline] pub fn bit_7(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) + } } #[inline] pub fn set_bit_7(&mut self, val: ::std::os::raw::c_uint) { @@ -187,7 +207,9 @@ impl capabilities { } #[inline] pub fn bit_8(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) + } } #[inline] pub fn set_bit_8(&mut self, val: ::std::os::raw::c_uint) { @@ -198,7 +220,9 @@ impl capabilities { } #[inline] pub fn bit_9(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) + } } #[inline] pub fn set_bit_9(&mut self, val: ::std::os::raw::c_uint) { @@ -209,7 +233,9 @@ impl capabilities { } #[inline] pub fn bit_10(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) + } } #[inline] pub fn set_bit_10(&mut self, val: ::std::os::raw::c_uint) { @@ -220,7 +246,9 @@ impl capabilities { } #[inline] pub fn bit_11(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) + } } #[inline] pub fn set_bit_11(&mut self, val: ::std::os::raw::c_uint) { @@ -231,7 +259,9 @@ impl capabilities { } #[inline] pub fn bit_12(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) + } } #[inline] pub fn set_bit_12(&mut self, val: ::std::os::raw::c_uint) { @@ -242,7 +272,9 @@ impl capabilities { } #[inline] pub fn bit_13(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) + } } #[inline] pub fn set_bit_13(&mut self, val: ::std::os::raw::c_uint) { @@ -253,7 +285,9 @@ impl capabilities { } #[inline] pub fn bit_14(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) + } } #[inline] pub fn set_bit_14(&mut self, val: ::std::os::raw::c_uint) { @@ -264,7 +298,9 @@ impl capabilities { } #[inline] pub fn bit_15(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) + } } #[inline] pub fn set_bit_15(&mut self, val: ::std::os::raw::c_uint) { @@ -275,7 +311,9 @@ impl capabilities { } #[inline] pub fn bit_16(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) + } } #[inline] pub fn set_bit_16(&mut self, val: ::std::os::raw::c_uint) { @@ -286,7 +324,9 @@ impl capabilities { } #[inline] pub fn bit_17(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) + } } #[inline] pub fn set_bit_17(&mut self, val: ::std::os::raw::c_uint) { @@ -297,7 +337,9 @@ impl capabilities { } #[inline] pub fn bit_18(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) + } } #[inline] pub fn set_bit_18(&mut self, val: ::std::os::raw::c_uint) { @@ -308,7 +350,9 @@ impl capabilities { } #[inline] pub fn bit_19(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) + } } #[inline] pub fn set_bit_19(&mut self, val: ::std::os::raw::c_uint) { @@ -319,7 +363,9 @@ impl capabilities { } #[inline] pub fn bit_20(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) + } } #[inline] pub fn set_bit_20(&mut self, val: ::std::os::raw::c_uint) { @@ -330,7 +376,9 @@ impl capabilities { } #[inline] pub fn bit_21(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) + } } #[inline] pub fn set_bit_21(&mut self, val: ::std::os::raw::c_uint) { @@ -341,7 +389,9 @@ impl capabilities { } #[inline] pub fn bit_22(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) + } } #[inline] pub fn set_bit_22(&mut self, val: ::std::os::raw::c_uint) { @@ -352,7 +402,9 @@ impl capabilities { } #[inline] pub fn bit_23(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) + } } #[inline] pub fn set_bit_23(&mut self, val: ::std::os::raw::c_uint) { @@ -363,7 +415,9 @@ impl capabilities { } #[inline] pub fn bit_24(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) + } } #[inline] pub fn set_bit_24(&mut self, val: ::std::os::raw::c_uint) { @@ -374,7 +428,9 @@ impl capabilities { } #[inline] pub fn bit_25(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) + } } #[inline] pub fn set_bit_25(&mut self, val: ::std::os::raw::c_uint) { @@ -385,7 +441,9 @@ impl capabilities { } #[inline] pub fn bit_26(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) + } } #[inline] pub fn set_bit_26(&mut self, val: ::std::os::raw::c_uint) { @@ -396,7 +454,9 @@ impl capabilities { } #[inline] pub fn bit_27(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) + } } #[inline] pub fn set_bit_27(&mut self, val: ::std::os::raw::c_uint) { @@ -407,7 +467,9 @@ impl capabilities { } #[inline] pub fn bit_28(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) + } } #[inline] pub fn set_bit_28(&mut self, val: ::std::os::raw::c_uint) { @@ -418,7 +480,9 @@ impl capabilities { } #[inline] pub fn bit_29(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) + } } #[inline] pub fn set_bit_29(&mut self, val: ::std::os::raw::c_uint) { @@ -429,7 +493,9 @@ impl capabilities { } #[inline] pub fn bit_30(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) + } } #[inline] pub fn set_bit_30(&mut self, val: ::std::os::raw::c_uint) { @@ -440,7 +506,9 @@ impl capabilities { } #[inline] pub fn bit_31(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) + } } #[inline] pub fn set_bit_31(&mut self, val: ::std::os::raw::c_uint) { @@ -451,7 +519,9 @@ impl capabilities { } #[inline] pub fn bit_32(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) + } } #[inline] pub fn set_bit_32(&mut self, val: ::std::os::raw::c_uint) { @@ -462,7 +532,9 @@ impl capabilities { } #[inline] pub fn bit_33(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u32) + } } #[inline] pub fn set_bit_33(&mut self, val: ::std::os::raw::c_uint) { @@ -473,7 +545,9 @@ impl capabilities { } #[inline] pub fn bit_34(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u32) + } } #[inline] pub fn set_bit_34(&mut self, val: ::std::os::raw::c_uint) { @@ -484,7 +558,9 @@ impl capabilities { } #[inline] pub fn bit_35(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u32) + } } #[inline] pub fn set_bit_35(&mut self, val: ::std::os::raw::c_uint) { @@ -495,7 +571,9 @@ impl capabilities { } #[inline] pub fn bit_36(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) + } } #[inline] pub fn set_bit_36(&mut self, val: ::std::os::raw::c_uint) { @@ -506,7 +584,9 @@ impl capabilities { } #[inline] pub fn bit_37(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) + } } #[inline] pub fn set_bit_37(&mut self, val: ::std::os::raw::c_uint) { @@ -517,7 +597,9 @@ impl capabilities { } #[inline] pub fn bit_38(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) + } } #[inline] pub fn set_bit_38(&mut self, val: ::std::os::raw::c_uint) { @@ -528,7 +610,9 @@ impl capabilities { } #[inline] pub fn bit_39(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) + } } #[inline] pub fn set_bit_39(&mut self, val: ::std::os::raw::c_uint) { @@ -539,7 +623,9 @@ impl capabilities { } #[inline] pub fn bit_40(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) + } } #[inline] pub fn set_bit_40(&mut self, val: ::std::os::raw::c_uint) { @@ -550,7 +636,9 @@ impl capabilities { } #[inline] pub fn bit_41(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(40usize, 1u8) as u32) + } } #[inline] pub fn set_bit_41(&mut self, val: ::std::os::raw::c_uint) { @@ -603,8 +691,10 @@ impl capabilities { bit_40: ::std::os::raw::c_uint, bit_41: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 16usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 16usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let bit_1: u32 = unsafe { ::std::mem::transmute(bit_1) }; bit_1 as u64 diff --git a/tests/expectations/tests/issue-820-unused-template-param-in-alias.rs b/tests/expectations/tests/issue-820-unused-template-param-in-alias.rs index 23ef513f..3abfb89d 100644 --- a/tests/expectations/tests/issue-820-unused-template-param-in-alias.rs +++ b/tests/expectations/tests/issue-820-unused-template-param-in-alias.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type Foo_self_type = u8; diff --git a/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs b/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs index 36cae722..f14057bf 100644 --- a/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs +++ b/tests/expectations/tests/issue-826-generating-methods-when-asked-not-to.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-833-1.rs b/tests/expectations/tests/issue-833-1.rs index aa19dd1b..da5ae240 100644 --- a/tests/expectations/tests/issue-833-1.rs +++ b/tests/expectations/tests/issue-833-1.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct nsTArray { diff --git a/tests/expectations/tests/issue-833-2.rs b/tests/expectations/tests/issue-833-2.rs index c77f5923..42630af2 100644 --- a/tests/expectations/tests/issue-833-2.rs +++ b/tests/expectations/tests/issue-833-2.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] // If the output of this changes, please ensure issue-833-1.hpp changes too diff --git a/tests/expectations/tests/issue-833.rs b/tests/expectations/tests/issue-833.rs index 4ee4602a..e2ee6ad3 100644 --- a/tests/expectations/tests/issue-833.rs +++ b/tests/expectations/tests/issue-833.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct nsTArray<T> { diff --git a/tests/expectations/tests/issue-834.rs b/tests/expectations/tests/issue-834.rs index a8014fb9..03e0d44e 100644 --- a/tests/expectations/tests/issue-834.rs +++ b/tests/expectations/tests/issue-834.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue-888-enum-var-decl-jump.rs b/tests/expectations/tests/issue-888-enum-var-decl-jump.rs index df48ae24..35085a8d 100644 --- a/tests/expectations/tests/issue-888-enum-var-decl-jump.rs +++ b/tests/expectations/tests/issue-888-enum-var-decl-jump.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { 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 5ca34ebb..985ad446 100644 --- a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs +++ b/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs @@ -27,7 +27,9 @@ fn bindgen_test_layout_ShouldNotBeCopy() { concat!("Alignment of ", stringify!(ShouldNotBeCopy)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ShouldNotBeCopy>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ShouldNotBeCopy>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/issue-946.rs b/tests/expectations/tests/issue-946.rs index 14ed38c6..48d5e2d0 100644 --- a/tests/expectations/tests/issue-946.rs +++ b/tests/expectations/tests/issue-946.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/issue_311.rs b/tests/expectations/tests/issue_311.rs index b8575378..67ab8e52 100644 --- a/tests/expectations/tests/issue_311.rs +++ b/tests/expectations/tests/issue_311.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs index a2e80447..b07a8af4 100644 --- a/tests/expectations/tests/jsval_layout_opaque.rs +++ b/tests/expectations/tests/jsval_layout_opaque.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -213,7 +219,9 @@ impl Default for jsval_layout__bindgen_ty_1 { impl jsval_layout__bindgen_ty_1 { #[inline] pub fn payload47(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 47u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 47u8) as u64) + } } #[inline] pub fn set_payload47(&mut self, val: u64) { @@ -224,7 +232,9 @@ impl jsval_layout__bindgen_ty_1 { } #[inline] pub fn tag(&self) -> JSValueTag { - unsafe { ::std::mem::transmute(self._bitfield_1.get(47usize, 17u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(47usize, 17u8) as u32) + } } #[inline] pub fn set_tag(&mut self, val: JSValueTag) { @@ -238,8 +248,10 @@ impl jsval_layout__bindgen_ty_1 { payload47: u64, tag: JSValueTag, ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 47u8, { let payload47: u64 = unsafe { ::std::mem::transmute(payload47) }; payload47 as u64 @@ -284,8 +296,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).i32 as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .i32 as *const _ as usize }, 0usize, concat!( @@ -297,8 +309,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).u32 as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .u32 as *const _ as usize }, 0usize, concat!( @@ -310,8 +322,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).why as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .why as *const _ as usize }, 0usize, concat!( @@ -341,7 +353,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2>())).payload as *const _ as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2>())).payload + as *const _ as usize }, 0usize, concat!( @@ -370,7 +383,9 @@ fn bindgen_test_layout_jsval_layout() { concat!("Alignment of ", stringify!(jsval_layout)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asBits as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asBits as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -380,7 +395,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).debugView as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).debugView as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -390,7 +408,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).s as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).s as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -400,7 +420,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asDouble as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asDouble as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -410,7 +433,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asPtr as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -420,7 +445,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asWord as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asWord as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -430,7 +457,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asUIntPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asUIntPtr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/jsval_layout_opaque_1_0.rs b/tests/expectations/tests/jsval_layout_opaque_1_0.rs index b09d129c..30b39d20 100644 --- a/tests/expectations/tests/jsval_layout_opaque_1_0.rs +++ b/tests/expectations/tests/jsval_layout_opaque_1_0.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -261,7 +267,9 @@ impl Default for jsval_layout__bindgen_ty_1 { impl jsval_layout__bindgen_ty_1 { #[inline] pub fn payload47(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 47u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 47u8) as u64) + } } #[inline] pub fn set_payload47(&mut self, val: u64) { @@ -272,7 +280,9 @@ impl jsval_layout__bindgen_ty_1 { } #[inline] pub fn tag(&self) -> JSValueTag { - unsafe { ::std::mem::transmute(self._bitfield_1.get(47usize, 17u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(47usize, 17u8) as u32) + } } #[inline] pub fn set_tag(&mut self, val: JSValueTag) { @@ -286,8 +296,10 @@ impl jsval_layout__bindgen_ty_1 { payload47: u64, tag: JSValueTag, ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u64, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 47u8, { let payload47: u64 = unsafe { ::std::mem::transmute(payload47) }; payload47 as u64 @@ -332,8 +344,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).i32 as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .i32 as *const _ as usize }, 0usize, concat!( @@ -345,8 +357,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).u32 as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .u32 as *const _ as usize }, 0usize, concat!( @@ -358,8 +370,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())).why as *const _ - as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2__bindgen_ty_1>())) + .why as *const _ as usize }, 0usize, concat!( @@ -389,7 +401,8 @@ fn bindgen_test_layout_jsval_layout__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2>())).payload as *const _ as usize + &(*(::std::ptr::null::<jsval_layout__bindgen_ty_2>())).payload + as *const _ as usize }, 0usize, concat!( @@ -418,7 +431,9 @@ fn bindgen_test_layout_jsval_layout() { concat!("Alignment of ", stringify!(jsval_layout)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asBits as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asBits as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -428,7 +443,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).debugView as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).debugView as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -438,7 +456,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).s as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).s as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -448,7 +468,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asDouble as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asDouble as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -458,7 +481,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asPtr as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -468,7 +493,9 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asWord as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asWord as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -478,7 +505,10 @@ fn bindgen_test_layout_jsval_layout() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<jsval_layout>())).asUIntPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<jsval_layout>())).asUIntPtr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/keywords.rs b/tests/expectations/tests/keywords.rs index 35f518f8..db57bb08 100644 --- a/tests/expectations/tests/keywords.rs +++ b/tests/expectations/tests/keywords.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub static mut u8: ::std::os::raw::c_int; diff --git a/tests/expectations/tests/layout_align.rs b/tests/expectations/tests/layout_align.rs index 51fa1d1a..b98ff8b5 100644 --- a/tests/expectations/tests/layout_align.rs +++ b/tests/expectations/tests/layout_align.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -178,7 +184,10 @@ fn bindgen_test_layout_rte_eth_link() { concat!("Alignment of ", stringify!(rte_eth_link)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_link>())).link_speed as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_link>())).link_speed as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -191,7 +200,9 @@ fn bindgen_test_layout_rte_eth_link() { impl rte_eth_link { #[inline] pub fn link_duplex(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) + } } #[inline] pub fn set_link_duplex(&mut self, val: u16) { @@ -202,7 +213,9 @@ impl rte_eth_link { } #[inline] pub fn link_autoneg(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) + } } #[inline] pub fn set_link_autoneg(&mut self, val: u16) { @@ -213,7 +226,9 @@ impl rte_eth_link { } #[inline] pub fn link_status(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) + } } #[inline] pub fn set_link_status(&mut self, val: u16) { @@ -228,18 +243,23 @@ impl rte_eth_link { link_autoneg: u16, link_status: u16, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let link_duplex: u16 = unsafe { ::std::mem::transmute(link_duplex) }; + let link_duplex: u16 = + unsafe { ::std::mem::transmute(link_duplex) }; link_duplex as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let link_autoneg: u16 = unsafe { ::std::mem::transmute(link_autoneg) }; + let link_autoneg: u16 = + unsafe { ::std::mem::transmute(link_autoneg) }; link_autoneg as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let link_status: u16 = unsafe { ::std::mem::transmute(link_status) }; + let link_status: u16 = + unsafe { ::std::mem::transmute(link_status) }; link_status as u64 }); __bindgen_bitfield_unit diff --git a/tests/expectations/tests/layout_arp.rs b/tests/expectations/tests/layout_arp.rs index 28dfd53c..b8987d98 100644 --- a/tests/expectations/tests/layout_arp.rs +++ b/tests/expectations/tests/layout_arp.rs @@ -43,7 +43,10 @@ fn bindgen_test_layout_ether_addr() { concat!("Alignment of ", stringify!(ether_addr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ether_addr>())).addr_bytes as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ether_addr>())).addr_bytes as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -79,7 +82,9 @@ fn bindgen_test_layout_arp_ipv4() { concat!("Alignment of ", stringify!(arp_ipv4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_ipv4>())).arp_sha as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_ipv4>())).arp_sha as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +94,9 @@ fn bindgen_test_layout_arp_ipv4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_ipv4>())).arp_sip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_ipv4>())).arp_sip as *const _ as usize + }, 6usize, concat!( "Offset of field: ", @@ -99,7 +106,9 @@ fn bindgen_test_layout_arp_ipv4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_ipv4>())).arp_tha as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_ipv4>())).arp_tha as *const _ as usize + }, 10usize, concat!( "Offset of field: ", @@ -109,7 +118,9 @@ fn bindgen_test_layout_arp_ipv4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_ipv4>())).arp_tip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_ipv4>())).arp_tip as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -143,7 +154,9 @@ fn bindgen_test_layout_arp_hdr() { concat!("Alignment of ", stringify!(arp_hdr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_hrd as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_hrd as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -153,7 +166,9 @@ fn bindgen_test_layout_arp_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_pro as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_pro as *const _ as usize + }, 2usize, concat!( "Offset of field: ", @@ -163,7 +178,9 @@ fn bindgen_test_layout_arp_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_hln as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_hln as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -173,7 +190,9 @@ fn bindgen_test_layout_arp_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_pln as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_pln as *const _ as usize + }, 5usize, concat!( "Offset of field: ", @@ -183,7 +202,9 @@ fn bindgen_test_layout_arp_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_op as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_op as *const _ as usize + }, 6usize, concat!( "Offset of field: ", @@ -193,7 +214,9 @@ fn bindgen_test_layout_arp_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<arp_hdr>())).arp_data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<arp_hdr>())).arp_data as *const _ as usize + }, 8usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs index 0da08871..8ddbbb1f 100644 --- a/tests/expectations/tests/layout_array.rs +++ b/tests/expectations/tests/layout_array.rs @@ -24,10 +24,12 @@ pub struct rte_mempool { /// it will most likely point to a different type of data structure, and /// will be transparent to the application programmer. /// This function should set mp->pool_data. -pub type rte_mempool_alloc_t = - ::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool) -> ::std::os::raw::c_int>; +pub type rte_mempool_alloc_t = ::std::option::Option< + unsafe extern "C" fn(mp: *mut rte_mempool) -> ::std::os::raw::c_int, +>; /// Free the opaque private data pointed to by mp->pool_data pointer. -pub type rte_mempool_free_t = ::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool)>; +pub type rte_mempool_free_t = + ::std::option::Option<unsafe extern "C" fn(mp: *mut rte_mempool)>; /// Enqueue an object into the external pool. pub type rte_mempool_enqueue_t = ::std::option::Option< unsafe extern "C" fn( @@ -45,8 +47,9 @@ pub type rte_mempool_dequeue_t = ::std::option::Option< ) -> ::std::os::raw::c_int, >; /// Return the number of available objects in the external pool. -pub type rte_mempool_get_count = - ::std::option::Option<unsafe extern "C" fn(mp: *const rte_mempool) -> ::std::os::raw::c_uint>; +pub type rte_mempool_get_count = ::std::option::Option< + unsafe extern "C" fn(mp: *const rte_mempool) -> ::std::os::raw::c_uint, +>; /// Structure defining mempool operations structure #[repr(C)] #[repr(align(64))] @@ -79,7 +82,10 @@ fn bindgen_test_layout_rte_mempool_ops() { concat!("Alignment of ", stringify!(rte_mempool_ops)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).name as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).name as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -89,7 +95,10 @@ fn bindgen_test_layout_rte_mempool_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).alloc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).alloc as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -99,7 +108,10 @@ fn bindgen_test_layout_rte_mempool_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).free as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).free as *const _ + as usize + }, 40usize, concat!( "Offset of field: ", @@ -109,7 +121,10 @@ fn bindgen_test_layout_rte_mempool_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).enqueue as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).enqueue as *const _ + as usize + }, 48usize, concat!( "Offset of field: ", @@ -119,7 +134,10 @@ fn bindgen_test_layout_rte_mempool_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).dequeue as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).dequeue as *const _ + as usize + }, 56usize, concat!( "Offset of field: ", @@ -129,7 +147,10 @@ fn bindgen_test_layout_rte_mempool_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops>())).get_count as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops>())).get_count as *const _ + as usize + }, 64usize, concat!( "Offset of field: ", @@ -146,12 +167,12 @@ impl Default for rte_mempool_ops { } impl ::std::cmp::PartialEq for rte_mempool_ops { fn eq(&self, other: &rte_mempool_ops) -> bool { - self.name == other.name - && self.alloc == other.alloc - && self.free == other.free - && self.enqueue == other.enqueue - && self.dequeue == other.dequeue - && self.get_count == other.get_count + self.name == other.name && + self.alloc == other.alloc && + self.free == other.free && + self.enqueue == other.enqueue && + self.dequeue == other.dequeue && + self.get_count == other.get_count } } /// The rte_spinlock_t type. @@ -174,7 +195,10 @@ fn bindgen_test_layout_rte_spinlock_t() { concat!("Alignment of ", stringify!(rte_spinlock_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_spinlock_t>())).locked as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_spinlock_t>())).locked as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -216,7 +240,10 @@ fn bindgen_test_layout_rte_mempool_ops_table() { concat!("Alignment of ", stringify!(rte_mempool_ops_table)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops_table>())).sl as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops_table>())).sl as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -226,7 +253,10 @@ fn bindgen_test_layout_rte_mempool_ops_table() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops_table>())).num_ops as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops_table>())).num_ops + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -236,7 +266,10 @@ fn bindgen_test_layout_rte_mempool_ops_table() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mempool_ops_table>())).ops as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mempool_ops_table>())).ops as *const _ + as usize + }, 64usize, concat!( "Offset of field: ", @@ -280,7 +313,8 @@ fn bindgen_test_layout_malloc_heap__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<malloc_heap__bindgen_ty_1>())).lh_first as *const _ as usize + &(*(::std::ptr::null::<malloc_heap__bindgen_ty_1>())).lh_first + as *const _ as usize }, 0usize, concat!( @@ -309,7 +343,9 @@ fn bindgen_test_layout_malloc_heap() { concat!("Alignment of ", stringify!(malloc_heap)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<malloc_heap>())).lock as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<malloc_heap>())).lock as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -319,7 +355,10 @@ fn bindgen_test_layout_malloc_heap() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<malloc_heap>())).free_head as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<malloc_heap>())).free_head as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -329,7 +368,10 @@ fn bindgen_test_layout_malloc_heap() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<malloc_heap>())).alloc_count as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<malloc_heap>())).alloc_count as *const _ + as usize + }, 112usize, concat!( "Offset of field: ", @@ -339,7 +381,10 @@ fn bindgen_test_layout_malloc_heap() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<malloc_heap>())).total_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<malloc_heap>())).total_size as *const _ + as usize + }, 120usize, concat!( "Offset of field: ", @@ -356,10 +401,10 @@ impl Default for malloc_heap { } impl ::std::cmp::PartialEq for malloc_heap { fn eq(&self, other: &malloc_heap) -> bool { - self.lock == other.lock - && self.free_head == other.free_head - && self.alloc_count == other.alloc_count - && self.total_size == other.total_size + self.lock == other.lock && + self.free_head == other.free_head && + self.alloc_count == other.alloc_count && + self.total_size == other.total_size } } #[repr(C)] diff --git a/tests/expectations/tests/layout_array_too_long.rs b/tests/expectations/tests/layout_array_too_long.rs index 27dd96ff..2cd154af 100644 --- a/tests/expectations/tests/layout_array_too_long.rs +++ b/tests/expectations/tests/layout_array_too_long.rs @@ -107,7 +107,9 @@ fn bindgen_test_layout_ip_frag_key() { concat!("Alignment of ", stringify!(ip_frag_key)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).src_dst as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).src_dst as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -117,7 +119,9 @@ fn bindgen_test_layout_ip_frag_key() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).id as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).id as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -127,7 +131,9 @@ fn bindgen_test_layout_ip_frag_key() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).key_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).key_len as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -179,7 +185,8 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_next as *const _ as usize + &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_next + as *const _ as usize }, 0usize, concat!( @@ -191,7 +198,8 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_prev as *const _ as usize + &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_prev + as *const _ as usize }, 8usize, concat!( @@ -220,7 +228,9 @@ fn bindgen_test_layout_ip_frag_pkt() { concat!("Alignment of ", stringify!(ip_frag_pkt)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).lru as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).lru as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -230,7 +240,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).key as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).key as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -240,7 +252,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).start as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).start as *const _ as usize + }, 56usize, concat!( "Offset of field: ", @@ -250,7 +264,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).total_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).total_size as *const _ + as usize + }, 64usize, concat!( "Offset of field: ", @@ -260,7 +277,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).frag_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).frag_size as *const _ + as usize + }, 68usize, concat!( "Offset of field: ", @@ -270,7 +290,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).last_idx as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).last_idx as *const _ + as usize + }, 72usize, concat!( "Offset of field: ", @@ -280,7 +303,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).frags as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).frags as *const _ as usize + }, 80usize, concat!( "Offset of field: ", @@ -297,13 +322,13 @@ impl Default for ip_frag_pkt { } impl ::std::cmp::PartialEq for ip_frag_pkt { fn eq(&self, other: &ip_frag_pkt) -> bool { - self.lru == other.lru - && self.key == other.key - && self.start == other.start - && self.total_size == other.total_size - && self.frag_size == other.frag_size - && self.last_idx == other.last_idx - && self.frags == other.frags + self.lru == other.lru && + self.key == other.key && + self.start == other.start && + self.total_size == other.total_size && + self.frag_size == other.frag_size && + self.last_idx == other.last_idx && + self.frags == other.frags } } ///< fragment mbuf diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs index 2ea596fc..610a3914 100644 --- a/tests/expectations/tests/layout_cmdline_token.rs +++ b/tests/expectations/tests/layout_cmdline_token.rs @@ -28,7 +28,10 @@ fn bindgen_test_layout_cmdline_token_hdr() { concat!("Alignment of ", stringify!(cmdline_token_hdr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_hdr>())).ops as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_hdr>())).ops as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +41,10 @@ fn bindgen_test_layout_cmdline_token_hdr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_hdr>())).offset as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_hdr>())).offset as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -85,7 +91,9 @@ pub struct cmdline_token_ops { >, /// 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, + 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< @@ -118,7 +126,10 @@ fn bindgen_test_layout_cmdline_token_ops() { concat!("Alignment of ", stringify!(cmdline_token_ops)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_ops>())).parse as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_ops>())).parse as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -129,7 +140,8 @@ fn bindgen_test_layout_cmdline_token_ops() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<cmdline_token_ops>())).complete_get_nb as *const _ as usize + &(*(::std::ptr::null::<cmdline_token_ops>())).complete_get_nb + as *const _ as usize }, 8usize, concat!( @@ -141,7 +153,8 @@ fn bindgen_test_layout_cmdline_token_ops() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<cmdline_token_ops>())).complete_get_elt as *const _ as usize + &(*(::std::ptr::null::<cmdline_token_ops>())).complete_get_elt + as *const _ as usize }, 16usize, concat!( @@ -152,7 +165,10 @@ fn bindgen_test_layout_cmdline_token_ops() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_ops>())).get_help as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_ops>())).get_help as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -192,7 +208,10 @@ fn bindgen_test_layout_cmdline_token_num_data() { concat!("Alignment of ", stringify!(cmdline_token_num_data)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_num_data>())).type_ as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_num_data>())).type_ as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -226,7 +245,10 @@ fn bindgen_test_layout_cmdline_token_num() { concat!("Alignment of ", stringify!(cmdline_token_num)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_num>())).hdr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_num>())).hdr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -236,7 +258,10 @@ fn bindgen_test_layout_cmdline_token_num() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<cmdline_token_num>())).num_data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<cmdline_token_num>())).num_data as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs index d3b22e81..d10e7740 100644 --- a/tests/expectations/tests/layout_eth_conf.rs +++ b/tests/expectations/tests/layout_eth_conf.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -167,7 +173,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { concat!("Alignment of ", stringify!(rte_eth_rxmode)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).mq_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).mq_mode as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -177,7 +186,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).max_rx_pkt_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).max_rx_pkt_len + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -187,7 +199,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).split_hdr_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).split_hdr_size + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -205,7 +220,9 @@ impl Default for rte_eth_rxmode { impl rte_eth_rxmode { #[inline] pub fn header_split(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) + } } #[inline] pub fn set_header_split(&mut self, val: u16) { @@ -216,7 +233,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_ip_checksum(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) + } } #[inline] pub fn set_hw_ip_checksum(&mut self, val: u16) { @@ -227,7 +246,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_filter(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_filter(&mut self, val: u16) { @@ -238,7 +259,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_strip(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_strip(&mut self, val: u16) { @@ -249,7 +272,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_extend(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_extend(&mut self, val: u16) { @@ -260,7 +285,9 @@ impl rte_eth_rxmode { } #[inline] pub fn jumbo_frame(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) + } } #[inline] pub fn set_jumbo_frame(&mut self, val: u16) { @@ -271,7 +298,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_strip_crc(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) + } } #[inline] pub fn set_hw_strip_crc(&mut self, val: u16) { @@ -282,7 +311,9 @@ impl rte_eth_rxmode { } #[inline] pub fn enable_scatter(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) + } } #[inline] pub fn set_enable_scatter(&mut self, val: u16) { @@ -293,7 +324,9 @@ impl rte_eth_rxmode { } #[inline] pub fn enable_lro(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) + } } #[inline] pub fn set_enable_lro(&mut self, val: u16) { @@ -314,38 +347,48 @@ impl rte_eth_rxmode { enable_scatter: u16, enable_lro: u16, ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let header_split: u16 = unsafe { ::std::mem::transmute(header_split) }; + let header_split: u16 = + unsafe { ::std::mem::transmute(header_split) }; header_split as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let hw_ip_checksum: u16 = unsafe { ::std::mem::transmute(hw_ip_checksum) }; + let hw_ip_checksum: u16 = + unsafe { ::std::mem::transmute(hw_ip_checksum) }; hw_ip_checksum as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let hw_vlan_filter: u16 = unsafe { ::std::mem::transmute(hw_vlan_filter) }; + let hw_vlan_filter: u16 = + unsafe { ::std::mem::transmute(hw_vlan_filter) }; hw_vlan_filter as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { - let hw_vlan_strip: u16 = unsafe { ::std::mem::transmute(hw_vlan_strip) }; + let hw_vlan_strip: u16 = + unsafe { ::std::mem::transmute(hw_vlan_strip) }; hw_vlan_strip as u64 }); __bindgen_bitfield_unit.set(4usize, 1u8, { - let hw_vlan_extend: u16 = unsafe { ::std::mem::transmute(hw_vlan_extend) }; + let hw_vlan_extend: u16 = + unsafe { ::std::mem::transmute(hw_vlan_extend) }; hw_vlan_extend as u64 }); __bindgen_bitfield_unit.set(5usize, 1u8, { - let jumbo_frame: u16 = unsafe { ::std::mem::transmute(jumbo_frame) }; + let jumbo_frame: u16 = + unsafe { ::std::mem::transmute(jumbo_frame) }; jumbo_frame as u64 }); __bindgen_bitfield_unit.set(6usize, 1u8, { - let hw_strip_crc: u16 = unsafe { ::std::mem::transmute(hw_strip_crc) }; + let hw_strip_crc: u16 = + unsafe { ::std::mem::transmute(hw_strip_crc) }; hw_strip_crc as u64 }); __bindgen_bitfield_unit.set(7usize, 1u8, { - let enable_scatter: u16 = unsafe { ::std::mem::transmute(enable_scatter) }; + let enable_scatter: u16 = + unsafe { ::std::mem::transmute(enable_scatter) }; enable_scatter as u64 }); __bindgen_bitfield_unit.set(8usize, 1u8, { @@ -392,7 +435,10 @@ fn bindgen_test_layout_rte_eth_txmode() { concat!("Alignment of ", stringify!(rte_eth_txmode)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_txmode>())).mq_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_txmode>())).mq_mode as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -402,7 +448,9 @@ fn bindgen_test_layout_rte_eth_txmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_txmode>())).pvid as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_txmode>())).pvid as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -420,7 +468,9 @@ impl Default for rte_eth_txmode { impl rte_eth_txmode { #[inline] pub fn hw_vlan_reject_tagged(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_reject_tagged(&mut self, val: u8) { @@ -431,7 +481,9 @@ impl rte_eth_txmode { } #[inline] pub fn hw_vlan_reject_untagged(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_reject_untagged(&mut self, val: u8) { @@ -442,7 +494,9 @@ impl rte_eth_txmode { } #[inline] pub fn hw_vlan_insert_pvid(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_insert_pvid(&mut self, val: u8) { @@ -457,10 +511,13 @@ impl rte_eth_txmode { hw_vlan_reject_untagged: u8, hw_vlan_insert_pvid: u8, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let hw_vlan_reject_tagged: u8 = unsafe { ::std::mem::transmute(hw_vlan_reject_tagged) }; + let hw_vlan_reject_tagged: u8 = + unsafe { ::std::mem::transmute(hw_vlan_reject_tagged) }; hw_vlan_reject_tagged as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { @@ -469,7 +526,8 @@ impl rte_eth_txmode { hw_vlan_reject_untagged as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let hw_vlan_insert_pvid: u8 = unsafe { ::std::mem::transmute(hw_vlan_insert_pvid) }; + let hw_vlan_insert_pvid: u8 = + unsafe { ::std::mem::transmute(hw_vlan_insert_pvid) }; hw_vlan_insert_pvid as u64 }); __bindgen_bitfield_unit @@ -513,7 +571,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { concat!("Alignment of ", stringify!(rte_eth_rss_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -523,7 +584,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key_len as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -533,7 +597,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_hf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_hf as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -621,8 +688,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())).vlan_id as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())) + .vlan_id as *const _ as usize }, 0usize, concat!( @@ -634,8 +701,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())).pools as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())) + .pools as *const _ as usize }, 8usize, concat!( @@ -660,7 +727,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -672,8 +740,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).enable_default_pool as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())) + .enable_default_pool as *const _ as usize }, 4usize, concat!( @@ -685,7 +753,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).default_pool as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).default_pool + as *const _ as usize }, 5usize, concat!( @@ -697,7 +766,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_pool_maps as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_pool_maps + as *const _ as usize }, 6usize, concat!( @@ -708,7 +778,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).pool_map as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).pool_map + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -718,7 +791,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).dcb_tc as *const _ + as usize + }, 1032usize, concat!( "Offset of field: ", @@ -754,7 +830,10 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { concat!("Alignment of ", stringify!(rte_eth_dcb_rx_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).nb_tcs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).nb_tcs as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -764,7 +843,10 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).dcb_tc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -801,7 +883,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -812,7 +895,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).dcb_tc + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -848,7 +934,10 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { concat!("Alignment of ", stringify!(rte_eth_dcb_tx_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).nb_tcs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).nb_tcs as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -858,7 +947,10 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).dcb_tc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -893,7 +985,8 @@ fn bindgen_test_layout_rte_eth_vmdq_tx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_tx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_tx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -952,8 +1045,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).vlan_id as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())) + .vlan_id as *const _ as usize }, 0usize, concat!( @@ -965,8 +1058,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).pools as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).pools + as *const _ as usize }, 8usize, concat!( @@ -991,7 +1084,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -1003,8 +1097,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_default_pool as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_default_pool + as *const _ as usize }, 4usize, concat!( @@ -1016,7 +1110,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).default_pool as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).default_pool + as *const _ as usize }, 5usize, concat!( @@ -1028,7 +1123,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_loop_back as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_loop_back + as *const _ as usize }, 6usize, concat!( @@ -1040,7 +1136,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_pool_maps as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_pool_maps + as *const _ as usize }, 7usize, concat!( @@ -1051,7 +1148,10 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).rx_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).rx_mode as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1061,7 +1161,10 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).pool_map as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).pool_map + as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -1142,7 +1245,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { concat!("Alignment of ", stringify!(rte_eth_ipv4_flow)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).src_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).src_ip as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -1152,7 +1258,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).dst_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).dst_ip as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1162,7 +1271,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).tos as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).tos as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1172,7 +1284,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).ttl as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).ttl as *const _ + as usize + }, 9usize, concat!( "Offset of field: ", @@ -1182,7 +1297,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).proto as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).proto as *const _ + as usize + }, 10usize, concat!( "Offset of field: ", @@ -1220,7 +1338,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { concat!("Alignment of ", stringify!(rte_eth_ipv6_flow)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).src_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).src_ip as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -1230,7 +1351,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).dst_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).dst_ip as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -1240,7 +1364,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).tc as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -1250,7 +1377,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).proto as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).proto as *const _ + as usize + }, 33usize, concat!( "Offset of field: ", @@ -1260,7 +1390,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).hop_limits as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).hop_limits as *const _ + as usize + }, 34usize, concat!( "Offset of field: ", @@ -1308,7 +1441,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).vlan_tci_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).vlan_tci_mask + as *const _ as usize }, 0usize, concat!( @@ -1319,7 +1453,10 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv4_mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv4_mask as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1329,7 +1466,10 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv6_mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv6_mask as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -1340,7 +1480,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).src_port_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).src_port_mask + as *const _ as usize }, 52usize, concat!( @@ -1352,7 +1493,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).dst_port_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).dst_port_mask + as *const _ as usize }, 54usize, concat!( @@ -1364,7 +1506,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).mac_addr_byte_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).mac_addr_byte_mask + as *const _ as usize }, 56usize, concat!( @@ -1376,7 +1519,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_id_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_id_mask + as *const _ as usize }, 60usize, concat!( @@ -1388,7 +1532,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_type_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_type_mask + as *const _ as usize }, 64usize, concat!( @@ -1432,7 +1577,10 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { concat!("Alignment of ", stringify!(rte_eth_flex_payload_cfg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).type_ as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).type_ + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1443,7 +1591,8 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).src_offset as *const _ as usize + &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).src_offset + as *const _ as usize }, 4usize, concat!( @@ -1481,7 +1630,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).flow_type as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).flow_type + as *const _ as usize }, 0usize, concat!( @@ -1492,7 +1642,10 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).mask as *const _ + as usize + }, 2usize, concat!( "Offset of field: ", @@ -1528,7 +1681,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_payloads as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_payloads + as *const _ as usize }, 0usize, concat!( @@ -1540,7 +1694,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_flexmasks as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_flexmasks + as *const _ as usize }, 2usize, concat!( @@ -1551,7 +1706,10 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_set as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_set + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -1562,7 +1720,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_mask + as *const _ as usize }, 292usize, concat!( @@ -1609,7 +1768,9 @@ fn bindgen_test_layout_rte_fdir_conf() { concat!("Alignment of ", stringify!(rte_fdir_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).mode as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1619,7 +1780,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).pballoc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).pballoc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1629,7 +1793,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).status as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).status as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1639,7 +1806,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).drop_queue as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).drop_queue as *const _ + as usize + }, 12usize, concat!( "Offset of field: ", @@ -1649,7 +1819,9 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).mask as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -1659,7 +1831,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).flex_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).flex_conf as *const _ + as usize + }, 84usize, concat!( "Offset of field: ", @@ -1696,7 +1871,9 @@ fn bindgen_test_layout_rte_intr_conf() { concat!("Alignment of ", stringify!(rte_intr_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_intr_conf>())).lsc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_intr_conf>())).lsc as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1706,7 +1883,9 @@ fn bindgen_test_layout_rte_intr_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_intr_conf>())).rxq as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_intr_conf>())).rxq as *const _ as usize + }, 2usize, concat!( "Offset of field: ", @@ -1775,7 +1954,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).rss_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).rss_conf + as *const _ as usize }, 0usize, concat!( @@ -1787,8 +1967,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_dcb_conf as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_dcb_conf + as *const _ as usize }, 24usize, concat!( @@ -1800,7 +1980,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).dcb_rx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).dcb_rx_conf + as *const _ as usize }, 1064usize, concat!( @@ -1812,7 +1993,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_rx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_rx_conf + as *const _ as usize }, 1080usize, concat!( @@ -1850,8 +2032,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_dcb_tx_conf as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())) + .vmdq_dcb_tx_conf as *const _ as usize }, 0usize, concat!( @@ -1863,7 +2045,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).dcb_tx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).dcb_tx_conf + as *const _ as usize }, 0usize, concat!( @@ -1875,7 +2058,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_tx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_tx_conf + as *const _ as usize }, 0usize, concat!( @@ -1904,7 +2088,10 @@ fn bindgen_test_layout_rte_eth_conf() { concat!("Alignment of ", stringify!(rte_eth_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).link_speeds as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).link_speeds as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -1914,7 +2101,9 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).rxmode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).rxmode as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -1924,7 +2113,9 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).txmode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).txmode as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -1934,7 +2125,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).lpbk_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).lpbk_mode as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -1944,7 +2138,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).rx_adv_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).rx_adv_conf as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -1954,7 +2151,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).tx_adv_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).tx_adv_conf as *const _ + as usize + }, 2152usize, concat!( "Offset of field: ", @@ -1964,7 +2164,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).dcb_capability_en as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).dcb_capability_en + as *const _ as usize + }, 2164usize, concat!( "Offset of field: ", @@ -1974,7 +2177,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).fdir_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).fdir_conf as *const _ + as usize + }, 2168usize, concat!( "Offset of field: ", @@ -1984,7 +2190,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).intr_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).intr_conf as *const _ + as usize + }, 2940usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_eth_conf_1_0.rs b/tests/expectations/tests/layout_eth_conf_1_0.rs index 0234bbd4..9e6d18b2 100644 --- a/tests/expectations/tests/layout_eth_conf_1_0.rs +++ b/tests/expectations/tests/layout_eth_conf_1_0.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -210,7 +216,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { concat!("Alignment of ", stringify!(rte_eth_rxmode)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).mq_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).mq_mode as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -220,7 +229,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).max_rx_pkt_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).max_rx_pkt_len + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -230,7 +242,10 @@ fn bindgen_test_layout_rte_eth_rxmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rxmode>())).split_hdr_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rxmode>())).split_hdr_size + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -253,7 +268,9 @@ impl Default for rte_eth_rxmode { impl rte_eth_rxmode { #[inline] pub fn header_split(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) + } } #[inline] pub fn set_header_split(&mut self, val: u16) { @@ -264,7 +281,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_ip_checksum(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) + } } #[inline] pub fn set_hw_ip_checksum(&mut self, val: u16) { @@ -275,7 +294,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_filter(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_filter(&mut self, val: u16) { @@ -286,7 +307,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_strip(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_strip(&mut self, val: u16) { @@ -297,7 +320,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_vlan_extend(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) + } } #[inline] pub fn set_hw_vlan_extend(&mut self, val: u16) { @@ -308,7 +333,9 @@ impl rte_eth_rxmode { } #[inline] pub fn jumbo_frame(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) + } } #[inline] pub fn set_jumbo_frame(&mut self, val: u16) { @@ -319,7 +346,9 @@ impl rte_eth_rxmode { } #[inline] pub fn hw_strip_crc(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) + } } #[inline] pub fn set_hw_strip_crc(&mut self, val: u16) { @@ -330,7 +359,9 @@ impl rte_eth_rxmode { } #[inline] pub fn enable_scatter(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) + } } #[inline] pub fn set_enable_scatter(&mut self, val: u16) { @@ -341,7 +372,9 @@ impl rte_eth_rxmode { } #[inline] pub fn enable_lro(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) + } } #[inline] pub fn set_enable_lro(&mut self, val: u16) { @@ -362,38 +395,48 @@ impl rte_eth_rxmode { enable_scatter: u16, enable_lro: u16, ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let header_split: u16 = unsafe { ::std::mem::transmute(header_split) }; + let header_split: u16 = + unsafe { ::std::mem::transmute(header_split) }; header_split as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let hw_ip_checksum: u16 = unsafe { ::std::mem::transmute(hw_ip_checksum) }; + let hw_ip_checksum: u16 = + unsafe { ::std::mem::transmute(hw_ip_checksum) }; hw_ip_checksum as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let hw_vlan_filter: u16 = unsafe { ::std::mem::transmute(hw_vlan_filter) }; + let hw_vlan_filter: u16 = + unsafe { ::std::mem::transmute(hw_vlan_filter) }; hw_vlan_filter as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { - let hw_vlan_strip: u16 = unsafe { ::std::mem::transmute(hw_vlan_strip) }; + let hw_vlan_strip: u16 = + unsafe { ::std::mem::transmute(hw_vlan_strip) }; hw_vlan_strip as u64 }); __bindgen_bitfield_unit.set(4usize, 1u8, { - let hw_vlan_extend: u16 = unsafe { ::std::mem::transmute(hw_vlan_extend) }; + let hw_vlan_extend: u16 = + unsafe { ::std::mem::transmute(hw_vlan_extend) }; hw_vlan_extend as u64 }); __bindgen_bitfield_unit.set(5usize, 1u8, { - let jumbo_frame: u16 = unsafe { ::std::mem::transmute(jumbo_frame) }; + let jumbo_frame: u16 = + unsafe { ::std::mem::transmute(jumbo_frame) }; jumbo_frame as u64 }); __bindgen_bitfield_unit.set(6usize, 1u8, { - let hw_strip_crc: u16 = unsafe { ::std::mem::transmute(hw_strip_crc) }; + let hw_strip_crc: u16 = + unsafe { ::std::mem::transmute(hw_strip_crc) }; hw_strip_crc as u64 }); __bindgen_bitfield_unit.set(7usize, 1u8, { - let enable_scatter: u16 = unsafe { ::std::mem::transmute(enable_scatter) }; + let enable_scatter: u16 = + unsafe { ::std::mem::transmute(enable_scatter) }; enable_scatter as u64 }); __bindgen_bitfield_unit.set(8usize, 1u8, { @@ -440,7 +483,10 @@ fn bindgen_test_layout_rte_eth_txmode() { concat!("Alignment of ", stringify!(rte_eth_txmode)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_txmode>())).mq_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_txmode>())).mq_mode as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -450,7 +496,9 @@ fn bindgen_test_layout_rte_eth_txmode() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_txmode>())).pvid as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_txmode>())).pvid as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -473,7 +521,9 @@ impl Default for rte_eth_txmode { impl rte_eth_txmode { #[inline] pub fn hw_vlan_reject_tagged(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_reject_tagged(&mut self, val: u8) { @@ -484,7 +534,9 @@ impl rte_eth_txmode { } #[inline] pub fn hw_vlan_reject_untagged(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_reject_untagged(&mut self, val: u8) { @@ -495,7 +547,9 @@ impl rte_eth_txmode { } #[inline] pub fn hw_vlan_insert_pvid(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) + } } #[inline] pub fn set_hw_vlan_insert_pvid(&mut self, val: u8) { @@ -510,10 +564,13 @@ impl rte_eth_txmode { hw_vlan_reject_untagged: u8, hw_vlan_insert_pvid: u8, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let hw_vlan_reject_tagged: u8 = unsafe { ::std::mem::transmute(hw_vlan_reject_tagged) }; + let hw_vlan_reject_tagged: u8 = + unsafe { ::std::mem::transmute(hw_vlan_reject_tagged) }; hw_vlan_reject_tagged as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { @@ -522,7 +579,8 @@ impl rte_eth_txmode { hw_vlan_reject_untagged as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let hw_vlan_insert_pvid: u8 = unsafe { ::std::mem::transmute(hw_vlan_insert_pvid) }; + let hw_vlan_insert_pvid: u8 = + unsafe { ::std::mem::transmute(hw_vlan_insert_pvid) }; hw_vlan_insert_pvid as u64 }); __bindgen_bitfield_unit @@ -566,7 +624,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { concat!("Alignment of ", stringify!(rte_eth_rss_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -576,7 +637,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_key_len as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -586,7 +650,10 @@ fn bindgen_test_layout_rte_eth_rss_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_hf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_rss_conf>())).rss_hf as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -679,8 +746,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())).vlan_id as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())) + .vlan_id as *const _ as usize }, 0usize, concat!( @@ -692,8 +759,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())).pools as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf__bindgen_ty_1>())) + .pools as *const _ as usize }, 8usize, concat!( @@ -723,7 +790,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -735,8 +803,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).enable_default_pool as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())) + .enable_default_pool as *const _ as usize }, 4usize, concat!( @@ -748,7 +816,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).default_pool as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).default_pool + as *const _ as usize }, 5usize, concat!( @@ -760,7 +829,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_pool_maps as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).nb_pool_maps + as *const _ as usize }, 6usize, concat!( @@ -771,7 +841,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).pool_map as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).pool_map + as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -781,7 +854,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_conf>())).dcb_tc as *const _ + as usize + }, 1032usize, concat!( "Offset of field: ", @@ -822,7 +898,10 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { concat!("Alignment of ", stringify!(rte_eth_dcb_rx_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).nb_tcs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).nb_tcs as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -832,7 +911,10 @@ fn bindgen_test_layout_rte_eth_dcb_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_rx_conf>())).dcb_tc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -874,7 +956,8 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -885,7 +968,10 @@ fn bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_dcb_tx_conf>())).dcb_tc + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -926,7 +1012,10 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { concat!("Alignment of ", stringify!(rte_eth_dcb_tx_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).nb_tcs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).nb_tcs as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -936,7 +1025,10 @@ fn bindgen_test_layout_rte_eth_dcb_tx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).dcb_tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_dcb_tx_conf>())).dcb_tc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -976,7 +1068,8 @@ fn bindgen_test_layout_rte_eth_vmdq_tx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_tx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_tx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -1040,8 +1133,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).vlan_id as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())) + .vlan_id as *const _ as usize }, 0usize, concat!( @@ -1053,8 +1146,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).pools as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf__bindgen_ty_1>())).pools + as *const _ as usize }, 8usize, concat!( @@ -1084,7 +1177,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_queue_pools as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_queue_pools + as *const _ as usize }, 0usize, concat!( @@ -1096,8 +1190,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_default_pool as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_default_pool + as *const _ as usize }, 4usize, concat!( @@ -1109,7 +1203,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).default_pool as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).default_pool + as *const _ as usize }, 5usize, concat!( @@ -1121,7 +1216,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_loop_back as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).enable_loop_back + as *const _ as usize }, 6usize, concat!( @@ -1133,7 +1229,8 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_pool_maps as *const _ as usize + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).nb_pool_maps + as *const _ as usize }, 7usize, concat!( @@ -1144,7 +1241,10 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).rx_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).rx_mode as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1154,7 +1254,10 @@ fn bindgen_test_layout_rte_eth_vmdq_rx_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).pool_map as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_vmdq_rx_conf>())).pool_map + as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -1240,7 +1343,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { concat!("Alignment of ", stringify!(rte_eth_ipv4_flow)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).src_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).src_ip as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -1250,7 +1356,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).dst_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).dst_ip as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1260,7 +1369,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).tos as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).tos as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1270,7 +1382,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).ttl as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).ttl as *const _ + as usize + }, 9usize, concat!( "Offset of field: ", @@ -1280,7 +1395,10 @@ fn bindgen_test_layout_rte_eth_ipv4_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).proto as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv4_flow>())).proto as *const _ + as usize + }, 10usize, concat!( "Offset of field: ", @@ -1323,7 +1441,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { concat!("Alignment of ", stringify!(rte_eth_ipv6_flow)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).src_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).src_ip as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -1333,7 +1454,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).dst_ip as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).dst_ip as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -1343,7 +1467,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).tc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).tc as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -1353,7 +1480,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).proto as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).proto as *const _ + as usize + }, 33usize, concat!( "Offset of field: ", @@ -1363,7 +1493,10 @@ fn bindgen_test_layout_rte_eth_ipv6_flow() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).hop_limits as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_ipv6_flow>())).hop_limits as *const _ + as usize + }, 34usize, concat!( "Offset of field: ", @@ -1416,7 +1549,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).vlan_tci_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).vlan_tci_mask + as *const _ as usize }, 0usize, concat!( @@ -1427,7 +1561,10 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv4_mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv4_mask as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1437,7 +1574,10 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv6_mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).ipv6_mask as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -1448,7 +1588,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).src_port_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).src_port_mask + as *const _ as usize }, 52usize, concat!( @@ -1460,7 +1601,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).dst_port_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).dst_port_mask + as *const _ as usize }, 54usize, concat!( @@ -1472,7 +1614,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).mac_addr_byte_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).mac_addr_byte_mask + as *const _ as usize }, 56usize, concat!( @@ -1484,7 +1627,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_id_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_id_mask + as *const _ as usize }, 60usize, concat!( @@ -1496,7 +1640,8 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_type_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_masks>())).tunnel_type_mask + as *const _ as usize }, 64usize, concat!( @@ -1545,7 +1690,10 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { concat!("Alignment of ", stringify!(rte_eth_flex_payload_cfg)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).type_ as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).type_ + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1556,7 +1704,8 @@ fn bindgen_test_layout_rte_eth_flex_payload_cfg() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).src_offset as *const _ as usize + &(*(::std::ptr::null::<rte_eth_flex_payload_cfg>())).src_offset + as *const _ as usize }, 4usize, concat!( @@ -1599,7 +1748,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).flow_type as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).flow_type + as *const _ as usize }, 0usize, concat!( @@ -1610,7 +1760,10 @@ fn bindgen_test_layout_rte_eth_fdir_flex_mask() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_flex_mask>())).mask as *const _ + as usize + }, 2usize, concat!( "Offset of field: ", @@ -1651,7 +1804,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_payloads as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_payloads + as *const _ as usize }, 0usize, concat!( @@ -1663,7 +1817,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_flexmasks as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).nb_flexmasks + as *const _ as usize }, 2usize, concat!( @@ -1674,7 +1829,10 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_set as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_set + as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -1685,7 +1843,8 @@ fn bindgen_test_layout_rte_eth_fdir_flex_conf() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_mask as *const _ as usize + &(*(::std::ptr::null::<rte_eth_fdir_flex_conf>())).flex_mask + as *const _ as usize }, 292usize, concat!( @@ -1737,7 +1896,9 @@ fn bindgen_test_layout_rte_fdir_conf() { concat!("Alignment of ", stringify!(rte_fdir_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).mode as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1747,7 +1908,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).pballoc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).pballoc as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -1757,7 +1921,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).status as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).status as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -1767,7 +1934,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).drop_queue as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).drop_queue as *const _ + as usize + }, 12usize, concat!( "Offset of field: ", @@ -1777,7 +1947,9 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).mask as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -1787,7 +1959,10 @@ fn bindgen_test_layout_rte_fdir_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_fdir_conf>())).flex_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_fdir_conf>())).flex_conf as *const _ + as usize + }, 84usize, concat!( "Offset of field: ", @@ -1829,7 +2004,9 @@ fn bindgen_test_layout_rte_intr_conf() { concat!("Alignment of ", stringify!(rte_intr_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_intr_conf>())).lsc as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_intr_conf>())).lsc as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -1839,7 +2016,9 @@ fn bindgen_test_layout_rte_intr_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_intr_conf>())).rxq as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_intr_conf>())).rxq as *const _ as usize + }, 2usize, concat!( "Offset of field: ", @@ -1913,7 +2092,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).rss_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).rss_conf + as *const _ as usize }, 0usize, concat!( @@ -1925,8 +2105,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_dcb_conf as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_dcb_conf + as *const _ as usize }, 24usize, concat!( @@ -1938,7 +2118,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).dcb_rx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).dcb_rx_conf + as *const _ as usize }, 1064usize, concat!( @@ -1950,7 +2131,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_rx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_1>())).vmdq_rx_conf + as *const _ as usize }, 1080usize, concat!( @@ -1993,8 +2175,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_dcb_tx_conf as *const _ - as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())) + .vmdq_dcb_tx_conf as *const _ as usize }, 0usize, concat!( @@ -2006,7 +2188,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).dcb_tx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).dcb_tx_conf + as *const _ as usize }, 0usize, concat!( @@ -2018,7 +2201,8 @@ fn bindgen_test_layout_rte_eth_conf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_tx_conf as *const _ as usize + &(*(::std::ptr::null::<rte_eth_conf__bindgen_ty_2>())).vmdq_tx_conf + as *const _ as usize }, 0usize, concat!( @@ -2047,7 +2231,10 @@ fn bindgen_test_layout_rte_eth_conf() { concat!("Alignment of ", stringify!(rte_eth_conf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).link_speeds as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).link_speeds as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -2057,7 +2244,9 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).rxmode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).rxmode as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -2067,7 +2256,9 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).txmode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).txmode as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -2077,7 +2268,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).lpbk_mode as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).lpbk_mode as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -2087,7 +2281,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).rx_adv_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).rx_adv_conf as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -2097,7 +2294,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).tx_adv_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).tx_adv_conf as *const _ + as usize + }, 2152usize, concat!( "Offset of field: ", @@ -2107,7 +2307,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).dcb_capability_en as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).dcb_capability_en + as *const _ as usize + }, 2164usize, concat!( "Offset of field: ", @@ -2117,7 +2320,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).fdir_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).fdir_conf as *const _ + as usize + }, 2168usize, concat!( "Offset of field: ", @@ -2127,7 +2333,10 @@ fn bindgen_test_layout_rte_eth_conf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_eth_conf>())).intr_conf as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_eth_conf>())).intr_conf as *const _ + as usize + }, 2940usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_kni_mbuf.rs b/tests/expectations/tests/layout_kni_mbuf.rs index fd8047ae..b554aed5 100644 --- a/tests/expectations/tests/layout_kni_mbuf.rs +++ b/tests/expectations/tests/layout_kni_mbuf.rs @@ -48,7 +48,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { concat!("Alignment of ", stringify!(rte_kni_mbuf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).buf_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).buf_addr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -58,7 +61,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).buf_physaddr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).buf_physaddr as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -68,7 +74,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pad0 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pad0 as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -78,7 +86,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).data_off as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).data_off as *const _ + as usize + }, 18usize, concat!( "Offset of field: ", @@ -88,7 +99,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pad1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pad1 as *const _ as usize + }, 20usize, concat!( "Offset of field: ", @@ -98,7 +111,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).nb_segs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).nb_segs as *const _ + as usize + }, 22usize, concat!( "Offset of field: ", @@ -108,7 +124,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pad4 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pad4 as *const _ as usize + }, 23usize, concat!( "Offset of field: ", @@ -118,7 +136,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).ol_flags as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).ol_flags as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -128,7 +149,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pad2 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pad2 as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -138,7 +161,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pkt_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pkt_len as *const _ + as usize + }, 36usize, concat!( "Offset of field: ", @@ -148,7 +174,10 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).data_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).data_len as *const _ + as usize + }, 40usize, concat!( "Offset of field: ", @@ -158,7 +187,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pad3 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pad3 as *const _ as usize + }, 64usize, concat!( "Offset of field: ", @@ -168,7 +199,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).pool as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).pool as *const _ as usize + }, 72usize, concat!( "Offset of field: ", @@ -178,7 +211,9 @@ fn bindgen_test_layout_rte_kni_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_kni_mbuf>())).next as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_kni_mbuf>())).next as *const _ as usize + }, 80usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_large_align_field.rs b/tests/expectations/tests/layout_large_align_field.rs index a02eff58..bc6bbe45 100644 --- a/tests/expectations/tests/layout_large_align_field.rs +++ b/tests/expectations/tests/layout_large_align_field.rs @@ -143,7 +143,9 @@ fn bindgen_test_layout_ip_frag_key() { concat!("Alignment of ", stringify!(ip_frag_key)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).src_dst as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).src_dst as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -153,7 +155,9 @@ fn bindgen_test_layout_ip_frag_key() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).id as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).id as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -163,7 +167,9 @@ fn bindgen_test_layout_ip_frag_key() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_key>())).key_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_key>())).key_len as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -215,7 +221,8 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_next as *const _ as usize + &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_next + as *const _ as usize }, 0usize, concat!( @@ -227,7 +234,8 @@ fn bindgen_test_layout_ip_frag_pkt__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_prev as *const _ as usize + &(*(::std::ptr::null::<ip_frag_pkt__bindgen_ty_1>())).tqe_prev + as *const _ as usize }, 8usize, concat!( @@ -256,7 +264,9 @@ fn bindgen_test_layout_ip_frag_pkt() { concat!("Alignment of ", stringify!(ip_frag_pkt)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).lru as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).lru as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -266,7 +276,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).key as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).key as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -276,7 +288,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).start as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).start as *const _ as usize + }, 56usize, concat!( "Offset of field: ", @@ -286,7 +300,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).total_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).total_size as *const _ + as usize + }, 64usize, concat!( "Offset of field: ", @@ -296,7 +313,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).frag_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).frag_size as *const _ + as usize + }, 68usize, concat!( "Offset of field: ", @@ -306,7 +326,10 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).last_idx as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).last_idx as *const _ + as usize + }, 72usize, concat!( "Offset of field: ", @@ -316,7 +339,9 @@ fn bindgen_test_layout_ip_frag_pkt() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_pkt>())).frags as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_pkt>())).frags as *const _ as usize + }, 80usize, concat!( "Offset of field: ", @@ -350,7 +375,10 @@ fn bindgen_test_layout_ip_pkt_list() { concat!("Alignment of ", stringify!(ip_pkt_list)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_pkt_list>())).tqh_first as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_pkt_list>())).tqh_first as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -360,7 +388,10 @@ fn bindgen_test_layout_ip_pkt_list() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_pkt_list>())).tqh_last as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_pkt_list>())).tqh_last as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -407,7 +438,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { concat!("Alignment of ", stringify!(ip_frag_tbl_stat)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).find_num as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).find_num as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -417,7 +451,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).add_num as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).add_num as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -427,7 +464,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).del_num as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).del_num as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -437,7 +477,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).reuse_num as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).reuse_num as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -447,7 +490,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).fail_total as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).fail_total as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -457,7 +503,10 @@ fn bindgen_test_layout_ip_frag_tbl_stat() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ip_frag_tbl_stat>())).fail_nospace as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ip_frag_tbl_stat>())).fail_nospace + as *const _ as usize + }, 40usize, concat!( "Offset of field: ", @@ -513,7 +562,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { concat!("Alignment of ", stringify!(rte_ip_frag_tbl)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).max_cycles as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).max_cycles as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -523,7 +575,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).entry_mask as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).entry_mask as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -533,7 +588,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).max_entries as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).max_entries as *const _ + as usize + }, 12usize, concat!( "Offset of field: ", @@ -543,7 +601,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).use_entries as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).use_entries as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -553,7 +614,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).bucket_entries as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).bucket_entries + as *const _ as usize + }, 20usize, concat!( "Offset of field: ", @@ -563,7 +627,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).nb_entries as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).nb_entries as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -573,7 +640,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).nb_buckets as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).nb_buckets as *const _ + as usize + }, 28usize, concat!( "Offset of field: ", @@ -583,7 +653,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).last as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).last as *const _ + as usize + }, 32usize, concat!( "Offset of field: ", @@ -593,7 +666,9 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).lru as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).lru as *const _ as usize + }, 40usize, concat!( "Offset of field: ", @@ -603,7 +678,10 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).stat as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).stat as *const _ + as usize + }, 64usize, concat!( "Offset of field: ", @@ -613,7 +691,9 @@ fn bindgen_test_layout_rte_ip_frag_tbl() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_ip_frag_tbl>())).pkt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_ip_frag_tbl>())).pkt as *const _ as usize + }, 128usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_mbuf.rs b/tests/expectations/tests/layout_mbuf.rs index 6f95065d..51e5526e 100644 --- a/tests/expectations/tests/layout_mbuf.rs +++ b/tests/expectations/tests/layout_mbuf.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -114,7 +120,9 @@ fn bindgen_test_layout_rte_atomic16_t() { concat!("Alignment of ", stringify!(rte_atomic16_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_atomic16_t>())).cnt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_atomic16_t>())).cnt as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -201,7 +209,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt_atomic as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt_atomic + as *const _ as usize }, 0usize, concat!( @@ -212,7 +221,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -263,7 +275,9 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1() { impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { #[inline] pub fn l2_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) + } } #[inline] pub fn set_l2_type(&mut self, val: u32) { @@ -274,7 +288,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn l3_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) + } } #[inline] pub fn set_l3_type(&mut self, val: u32) { @@ -285,7 +301,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn l4_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) + } } #[inline] pub fn set_l4_type(&mut self, val: u32) { @@ -296,7 +314,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn tun_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u32) + } } #[inline] pub fn set_tun_type(&mut self, val: u32) { @@ -307,7 +327,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l2_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l2_type(&mut self, val: u32) { @@ -318,7 +340,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l3_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l3_type(&mut self, val: u32) { @@ -329,7 +353,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l4_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l4_type(&mut self, val: u32) { @@ -348,8 +374,10 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { inner_l3_type: u32, inner_l4_type: u32, ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 4u8, { let l2_type: u32 = unsafe { ::std::mem::transmute(l2_type) }; l2_type as u64 @@ -367,15 +395,18 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { tun_type as u64 }); __bindgen_bitfield_unit.set(16usize, 4u8, { - let inner_l2_type: u32 = unsafe { ::std::mem::transmute(inner_l2_type) }; + let inner_l2_type: u32 = + unsafe { ::std::mem::transmute(inner_l2_type) }; inner_l2_type as u64 }); __bindgen_bitfield_unit.set(20usize, 4u8, { - let inner_l3_type: u32 = unsafe { ::std::mem::transmute(inner_l3_type) }; + let inner_l3_type: u32 = + unsafe { ::std::mem::transmute(inner_l3_type) }; inner_l3_type as u64 }); __bindgen_bitfield_unit.set(24usize, 4u8, { - let inner_l4_type: u32 = unsafe { ::std::mem::transmute(inner_l4_type) }; + let inner_l4_type: u32 = + unsafe { ::std::mem::transmute(inner_l4_type) }; inner_l4_type as u64 }); __bindgen_bitfield_unit @@ -395,7 +426,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_2>())).packet_type as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_2>())).packet_type + as *const _ as usize }, 0usize, concat!( @@ -433,7 +465,8 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1 { #[repr(C)] #[derive(Copy, Clone)] pub union rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 { - pub __bindgen_anon_1: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + pub __bindgen_anon_1: + rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, pub lo: u32, _bindgen_union_align: u32, } @@ -444,52 +477,18 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { pub id: u16, } #[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 { - & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . hash as * const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(hash) - ) - ); - assert_eq!( - unsafe { - & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . id as * const _ as usize - }, - 2usize, - concat!( - "Offset of field: ", - stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(id) - ) - ); +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 { & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . hash as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( hash ) ) ); + assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . id as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( id ) ) ); } #[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>(), + ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>( + ), 4usize, concat!( "Size of: ", @@ -497,7 +496,9 @@ fn bindgen_test_layout_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>(), + ::std::mem::align_of::< + rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1, + >(), 4usize, concat!( "Alignment of ", @@ -506,8 +507,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>())).lo - as *const _ as usize + &(*(::std::ptr::null::< + rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1, + >())) + .lo as *const _ as usize }, 0usize, concat!( @@ -543,7 +546,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>())).hi as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>())).hi + as *const _ as usize }, 4usize, concat!( @@ -585,7 +589,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).lo as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).lo + as *const _ as usize }, 0usize, concat!( @@ -597,7 +602,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).hi as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).hi + as *const _ as usize }, 4usize, concat!( @@ -621,7 +627,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).rss as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).rss as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -631,7 +640,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).fdir as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).fdir as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -641,7 +653,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).sched as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).sched as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -651,7 +666,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).usr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).usr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -688,7 +706,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).userdata as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).userdata + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -698,7 +719,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).udata64 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).udata64 + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -749,7 +773,9 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_5__bindgen_ty_1() { impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { #[inline] pub fn l2_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u64) + } } #[inline] pub fn set_l2_len(&mut self, val: u64) { @@ -760,7 +786,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn l3_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 9u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 9u8) as u64) + } } #[inline] pub fn set_l3_len(&mut self, val: u64) { @@ -771,7 +799,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn l4_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u64) + } } #[inline] pub fn set_l4_len(&mut self, val: u64) { @@ -782,7 +812,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn tso_segsz(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 16u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 16u8) as u64) + } } #[inline] pub fn set_tso_segsz(&mut self, val: u64) { @@ -793,7 +825,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn outer_l3_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 9u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(40usize, 9u8) as u64) + } } #[inline] pub fn set_outer_l3_len(&mut self, val: u64) { @@ -804,7 +838,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn outer_l2_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(49usize, 7u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(49usize, 7u8) as u64) + } } #[inline] pub fn set_outer_l2_len(&mut self, val: u64) { @@ -822,8 +858,10 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { outer_l3_len: u64, outer_l2_len: u64, ) -> __BindgenBitfieldUnit<[u8; 8usize], u16> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u16> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u16, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 7u8, { let l2_len: u64 = unsafe { ::std::mem::transmute(l2_len) }; l2_len as u64 @@ -841,11 +879,13 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { tso_segsz as u64 }); __bindgen_bitfield_unit.set(40usize, 9u8, { - let outer_l3_len: u64 = unsafe { ::std::mem::transmute(outer_l3_len) }; + let outer_l3_len: u64 = + unsafe { ::std::mem::transmute(outer_l3_len) }; outer_l3_len as u64 }); __bindgen_bitfield_unit.set(49usize, 7u8, { - let outer_l2_len: u64 = unsafe { ::std::mem::transmute(outer_l2_len) }; + let outer_l2_len: u64 = + unsafe { ::std::mem::transmute(outer_l2_len) }; outer_l2_len as u64 }); __bindgen_bitfield_unit @@ -865,7 +905,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_5>())).tx_offload as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_5>())).tx_offload + as *const _ as usize }, 0usize, concat!( @@ -894,7 +935,9 @@ fn bindgen_test_layout_rte_mbuf() { concat!("Alignment of ", stringify!(rte_mbuf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).cacheline0 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).cacheline0 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -904,7 +947,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_addr as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -914,7 +959,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_physaddr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_physaddr as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -924,7 +972,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_len as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -934,7 +984,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).rearm_data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).rearm_data as *const _ as usize + }, 18usize, concat!( "Offset of field: ", @@ -944,7 +996,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).data_off as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).data_off as *const _ as usize + }, 18usize, concat!( "Offset of field: ", @@ -954,7 +1008,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).nb_segs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).nb_segs as *const _ as usize + }, 22usize, concat!( "Offset of field: ", @@ -964,7 +1020,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).port as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).port as *const _ as usize + }, 23usize, concat!( "Offset of field: ", @@ -974,7 +1032,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).ol_flags as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).ol_flags as *const _ as usize + }, 24usize, concat!( "Offset of field: ", @@ -984,7 +1044,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).rx_descriptor_fields1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).rx_descriptor_fields1 + as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -994,7 +1057,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).pkt_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).pkt_len as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -1004,7 +1069,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).data_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).data_len as *const _ as usize + }, 40usize, concat!( "Offset of field: ", @@ -1014,7 +1081,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci as *const _ as usize + }, 42usize, concat!( "Offset of field: ", @@ -1024,7 +1093,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).hash as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).hash as *const _ as usize + }, 44usize, concat!( "Offset of field: ", @@ -1034,7 +1105,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).seqn as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).seqn as *const _ as usize + }, 52usize, concat!( "Offset of field: ", @@ -1044,7 +1117,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci_outer as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci_outer as *const _ + as usize + }, 56usize, concat!( "Offset of field: ", @@ -1054,7 +1130,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).cacheline1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).cacheline1 as *const _ as usize + }, 64usize, concat!( "Offset of field: ", @@ -1064,7 +1142,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).pool as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).pool as *const _ as usize + }, 72usize, concat!( "Offset of field: ", @@ -1074,7 +1154,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).next as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).next as *const _ as usize + }, 80usize, concat!( "Offset of field: ", @@ -1084,7 +1166,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).priv_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).priv_size as *const _ as usize + }, 96usize, concat!( "Offset of field: ", @@ -1094,7 +1178,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).timesync as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).timesync as *const _ as usize + }, 98usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/layout_mbuf_1_0.rs b/tests/expectations/tests/layout_mbuf_1_0.rs index b1fb2b9d..cf05efd3 100644 --- a/tests/expectations/tests/layout_mbuf_1_0.rs +++ b/tests/expectations/tests/layout_mbuf_1_0.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -157,7 +163,9 @@ fn bindgen_test_layout_rte_atomic16_t() { concat!("Alignment of ", stringify!(rte_atomic16_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_atomic16_t>())).cnt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_atomic16_t>())).cnt as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -248,7 +256,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt_atomic as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt_atomic + as *const _ as usize }, 0usize, concat!( @@ -259,7 +268,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_1>())).refcnt + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -279,7 +291,8 @@ impl Clone for rte_mbuf__bindgen_ty_1 { pub struct rte_mbuf__bindgen_ty_2 { ///< L2/L3/L4 and tunnel information. pub packet_type: __BindgenUnionField<u32>, - pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_2__bindgen_ty_1>, + pub __bindgen_anon_1: + __BindgenUnionField<rte_mbuf__bindgen_ty_2__bindgen_ty_1>, pub bindgen_union_field: u32, } #[repr(C)] @@ -315,7 +328,9 @@ impl Clone for rte_mbuf__bindgen_ty_2__bindgen_ty_1 { impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { #[inline] pub fn l2_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) + } } #[inline] pub fn set_l2_type(&mut self, val: u32) { @@ -326,7 +341,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn l3_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) + } } #[inline] pub fn set_l3_type(&mut self, val: u32) { @@ -337,7 +354,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn l4_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) + } } #[inline] pub fn set_l4_type(&mut self, val: u32) { @@ -348,7 +367,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn tun_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u32) + } } #[inline] pub fn set_tun_type(&mut self, val: u32) { @@ -359,7 +380,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l2_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l2_type(&mut self, val: u32) { @@ -370,7 +393,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l3_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l3_type(&mut self, val: u32) { @@ -381,7 +406,9 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { } #[inline] pub fn inner_l4_type(&self) -> u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) + } } #[inline] pub fn set_inner_l4_type(&mut self, val: u32) { @@ -400,8 +427,10 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { inner_l3_type: u32, inner_l4_type: u32, ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 4u8, { let l2_type: u32 = unsafe { ::std::mem::transmute(l2_type) }; l2_type as u64 @@ -419,15 +448,18 @@ impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 { tun_type as u64 }); __bindgen_bitfield_unit.set(16usize, 4u8, { - let inner_l2_type: u32 = unsafe { ::std::mem::transmute(inner_l2_type) }; + let inner_l2_type: u32 = + unsafe { ::std::mem::transmute(inner_l2_type) }; inner_l2_type as u64 }); __bindgen_bitfield_unit.set(20usize, 4u8, { - let inner_l3_type: u32 = unsafe { ::std::mem::transmute(inner_l3_type) }; + let inner_l3_type: u32 = + unsafe { ::std::mem::transmute(inner_l3_type) }; inner_l3_type as u64 }); __bindgen_bitfield_unit.set(24usize, 4u8, { - let inner_l4_type: u32 = unsafe { ::std::mem::transmute(inner_l4_type) }; + let inner_l4_type: u32 = + unsafe { ::std::mem::transmute(inner_l4_type) }; inner_l4_type as u64 }); __bindgen_bitfield_unit @@ -447,7 +479,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_2>())).packet_type as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_2>())).packet_type + as *const _ as usize }, 0usize, concat!( @@ -485,8 +518,9 @@ 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, } @@ -497,49 +531,16 @@ pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { pub id: u16, } #[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 { - & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . hash as * const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(hash) - ) - ); - assert_eq!( - unsafe { - & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . id as * const _ as usize - }, - 2usize, - concat!( - "Offset of field: ", - stringify!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(id) - ) - ); +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 { & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . hash as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( hash ) ) ); + assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . id as * const _ as usize } , 2usize , concat ! ( "Offset 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 { +impl Clone + for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 +{ fn clone(&self) -> Self { *self } @@ -547,7 +548,8 @@ impl Clone for 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() { assert_eq!( - ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>(), + ::std::mem::size_of::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>( + ), 4usize, concat!( "Size of: ", @@ -555,7 +557,9 @@ fn bindgen_test_layout_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>(), + ::std::mem::align_of::< + rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1, + >(), 4usize, concat!( "Alignment of ", @@ -564,8 +568,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1>())).lo - as *const _ as usize + &(*(::std::ptr::null::< + rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1, + >())) + .lo as *const _ as usize }, 0usize, concat!( @@ -601,7 +607,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>())).hi as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_1>())).hi + as *const _ as usize }, 4usize, concat!( @@ -643,7 +650,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).lo as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).lo + as *const _ as usize }, 0usize, concat!( @@ -655,7 +663,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).hi as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3__bindgen_ty_2>())).hi + as *const _ as usize }, 4usize, concat!( @@ -684,7 +693,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_3)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).rss as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).rss as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -694,7 +706,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).fdir as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).fdir as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -704,7 +719,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).sched as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).sched as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -714,7 +732,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_3() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).usr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_3>())).usr as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -751,7 +772,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { concat!("Alignment of ", stringify!(rte_mbuf__bindgen_ty_4)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).userdata as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).userdata + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -761,7 +785,10 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_4() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).udata64 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_4>())).udata64 + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -781,7 +808,8 @@ impl Clone for rte_mbuf__bindgen_ty_4 { pub struct rte_mbuf__bindgen_ty_5 { ///< combined for easy fetch pub tx_offload: __BindgenUnionField<u64>, - pub __bindgen_anon_1: __BindgenUnionField<rte_mbuf__bindgen_ty_5__bindgen_ty_1>, + pub __bindgen_anon_1: + __BindgenUnionField<rte_mbuf__bindgen_ty_5__bindgen_ty_1>, pub bindgen_union_field: u64, } #[repr(C)] @@ -817,7 +845,9 @@ impl Clone for rte_mbuf__bindgen_ty_5__bindgen_ty_1 { impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { #[inline] pub fn l2_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u64) + } } #[inline] pub fn set_l2_len(&mut self, val: u64) { @@ -828,7 +858,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn l3_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 9u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 9u8) as u64) + } } #[inline] pub fn set_l3_len(&mut self, val: u64) { @@ -839,7 +871,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn l4_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u64) + } } #[inline] pub fn set_l4_len(&mut self, val: u64) { @@ -850,7 +884,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn tso_segsz(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 16u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(24usize, 16u8) as u64) + } } #[inline] pub fn set_tso_segsz(&mut self, val: u64) { @@ -861,7 +897,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn outer_l3_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 9u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(40usize, 9u8) as u64) + } } #[inline] pub fn set_outer_l3_len(&mut self, val: u64) { @@ -872,7 +910,9 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { } #[inline] pub fn outer_l2_len(&self) -> u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(49usize, 7u8) as u64) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(49usize, 7u8) as u64) + } } #[inline] pub fn set_outer_l2_len(&mut self, val: u64) { @@ -890,8 +930,10 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { outer_l3_len: u64, outer_l2_len: u64, ) -> __BindgenBitfieldUnit<[u8; 8usize], u16> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u16> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u16, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 7u8, { let l2_len: u64 = unsafe { ::std::mem::transmute(l2_len) }; l2_len as u64 @@ -909,11 +951,13 @@ impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 { tso_segsz as u64 }); __bindgen_bitfield_unit.set(40usize, 9u8, { - let outer_l3_len: u64 = unsafe { ::std::mem::transmute(outer_l3_len) }; + let outer_l3_len: u64 = + unsafe { ::std::mem::transmute(outer_l3_len) }; outer_l3_len as u64 }); __bindgen_bitfield_unit.set(49usize, 7u8, { - let outer_l2_len: u64 = unsafe { ::std::mem::transmute(outer_l2_len) }; + let outer_l2_len: u64 = + unsafe { ::std::mem::transmute(outer_l2_len) }; outer_l2_len as u64 }); __bindgen_bitfield_unit @@ -933,7 +977,8 @@ fn bindgen_test_layout_rte_mbuf__bindgen_ty_5() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_5>())).tx_offload as *const _ as usize + &(*(::std::ptr::null::<rte_mbuf__bindgen_ty_5>())).tx_offload + as *const _ as usize }, 0usize, concat!( @@ -957,7 +1002,9 @@ fn bindgen_test_layout_rte_mbuf() { concat!("Size of: ", stringify!(rte_mbuf)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).cacheline0 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).cacheline0 as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -967,7 +1014,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_addr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_addr as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -977,7 +1026,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_physaddr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_physaddr as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", @@ -987,7 +1039,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).buf_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).buf_len as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -997,7 +1051,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).rearm_data as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).rearm_data as *const _ as usize + }, 18usize, concat!( "Offset of field: ", @@ -1007,7 +1063,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).data_off as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).data_off as *const _ as usize + }, 18usize, concat!( "Offset of field: ", @@ -1017,7 +1075,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).nb_segs as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).nb_segs as *const _ as usize + }, 22usize, concat!( "Offset of field: ", @@ -1027,7 +1087,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).port as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).port as *const _ as usize + }, 23usize, concat!( "Offset of field: ", @@ -1037,7 +1099,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).ol_flags as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).ol_flags as *const _ as usize + }, 24usize, concat!( "Offset of field: ", @@ -1047,7 +1111,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).rx_descriptor_fields1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).rx_descriptor_fields1 + as *const _ as usize + }, 32usize, concat!( "Offset of field: ", @@ -1057,7 +1124,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).pkt_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).pkt_len as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -1067,7 +1136,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).data_len as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).data_len as *const _ as usize + }, 40usize, concat!( "Offset of field: ", @@ -1077,7 +1148,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci as *const _ as usize + }, 42usize, concat!( "Offset of field: ", @@ -1087,7 +1160,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).hash as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).hash as *const _ as usize + }, 44usize, concat!( "Offset of field: ", @@ -1097,7 +1172,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).seqn as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).seqn as *const _ as usize + }, 52usize, concat!( "Offset of field: ", @@ -1107,7 +1184,10 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci_outer as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).vlan_tci_outer as *const _ + as usize + }, 56usize, concat!( "Offset of field: ", @@ -1117,7 +1197,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).cacheline1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).cacheline1 as *const _ as usize + }, 64usize, concat!( "Offset of field: ", @@ -1127,7 +1209,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).pool as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).pool as *const _ as usize + }, 72usize, concat!( "Offset of field: ", @@ -1137,7 +1221,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).next as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).next as *const _ as usize + }, 80usize, concat!( "Offset of field: ", @@ -1147,7 +1233,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).priv_size as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).priv_size as *const _ as usize + }, 96usize, concat!( "Offset of field: ", @@ -1157,7 +1245,9 @@ fn bindgen_test_layout_rte_mbuf() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<rte_mbuf>())).timesync as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<rte_mbuf>())).timesync as *const _ as usize + }, 98usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/libclang_version_specific_generated_tests.rs b/tests/expectations/tests/libclang_version_specific_generated_tests.rs index 93cf0d47..2643709c 100644 --- a/tests/expectations/tests/libclang_version_specific_generated_tests.rs +++ b/tests/expectations/tests/libclang_version_specific_generated_tests.rs @@ -1 +1,4 @@ -include!(concat!(env!("OUT_DIR"), "/libclang_version_specific_generated_tests.rs")); +include!(concat!( + env!("OUT_DIR"), + "/libclang_version_specific_generated_tests.rs" +)); diff --git a/tests/expectations/tests/macro-expr-basic.rs b/tests/expectations/tests/macro-expr-basic.rs index 55590ff6..3f7b8099 100644 --- a/tests/expectations/tests/macro-expr-basic.rs +++ b/tests/expectations/tests/macro-expr-basic.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const FOO: u32 = 1; pub const BAR: u32 = 4; diff --git a/tests/expectations/tests/macro-expr-uncommon-token.rs b/tests/expectations/tests/macro-expr-uncommon-token.rs index 95093ad6..8c16a0d8 100644 --- a/tests/expectations/tests/macro-expr-uncommon-token.rs +++ b/tests/expectations/tests/macro-expr-uncommon-token.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const MODBUS_WOOT: u32 = 3; extern "C" { diff --git a/tests/expectations/tests/macro-redef.rs b/tests/expectations/tests/macro-redef.rs index e7132232..3133bc0e 100644 --- a/tests/expectations/tests/macro-redef.rs +++ b/tests/expectations/tests/macro-redef.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const FOO: u32 = 4; pub const BAR: u32 = 5; diff --git a/tests/expectations/tests/maddness-is-avoidable.rs b/tests/expectations/tests/maddness-is-avoidable.rs index b1eea1d0..0e0ae290 100644 --- a/tests/expectations/tests/maddness-is-avoidable.rs +++ b/tests/expectations/tests/maddness-is-avoidable.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/mangling-ios.rs b/tests/expectations/tests/mangling-ios.rs index 87df5e4a..90dc8d46 100644 --- a/tests/expectations/tests/mangling-ios.rs +++ b/tests/expectations/tests/mangling-ios.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/mangling-linux32.rs b/tests/expectations/tests/mangling-linux32.rs index 7fe8f33a..faa9a2f8 100644 --- a/tests/expectations/tests/mangling-linux32.rs +++ b/tests/expectations/tests/mangling-linux32.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/mangling-linux64.rs b/tests/expectations/tests/mangling-linux64.rs index 7fe8f33a..faa9a2f8 100644 --- a/tests/expectations/tests/mangling-linux64.rs +++ b/tests/expectations/tests/mangling-linux64.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/mangling-macos.rs b/tests/expectations/tests/mangling-macos.rs index 7101b321..cc1ba069 100644 --- a/tests/expectations/tests/mangling-macos.rs +++ b/tests/expectations/tests/mangling-macos.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/mangling-win64.rs b/tests/expectations/tests/mangling-win64.rs index 0d9c49fa..d8c55e1c 100644 --- a/tests/expectations/tests/mangling-win64.rs +++ b/tests/expectations/tests/mangling-win64.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/method-mangling.rs b/tests/expectations/tests/method-mangling.rs index f2eb6f98..7f72225a 100644 --- a/tests/expectations/tests/method-mangling.rs +++ b/tests/expectations/tests/method-mangling.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/module-whitelisted.rs b/tests/expectations/tests/module-whitelisted.rs index 3f2d304e..3771472d 100644 --- a/tests/expectations/tests/module-whitelisted.rs +++ b/tests/expectations/tests/module-whitelisted.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/msvc-no-usr.rs b/tests/expectations/tests/msvc-no-usr.rs index 94d5a671..e7cab0a0 100644 --- a/tests/expectations/tests/msvc-no-usr.rs +++ b/tests/expectations/tests/msvc-no-usr.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs b/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs index 86147bdd..d9c12e7b 100644 --- a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs +++ b/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/mutable.rs b/tests/expectations/tests/mutable.rs index d60e6cf7..bfd939d3 100644 --- a/tests/expectations/tests/mutable.rs +++ b/tests/expectations/tests/mutable.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -61,7 +64,10 @@ fn bindgen_test_layout_NonCopiable() { concat!("Alignment of ", stringify!(NonCopiable)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<NonCopiable>())).m_member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<NonCopiable>())).m_member as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -96,8 +102,8 @@ fn bindgen_test_layout_NonCopiableWithNonCopiableMutableMember() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<NonCopiableWithNonCopiableMutableMember>())).m_member as *const _ - as usize + &(*(::std::ptr::null::<NonCopiableWithNonCopiableMutableMember>())) + .m_member as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index dc51640e..7bb148f7 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -47,7 +47,12 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<A>())).b as *const _ as usize }, 0usize, - concat!("Offset of field: ", stringify!(A), "::", stringify!(b)) + concat!( + "Offset of field: ", + stringify!(A), + "::", + stringify!(b) + ) ); } } @@ -73,7 +78,8 @@ pub mod root { #[derive(Debug)] pub struct D<T> { pub m_c: root::C<T>, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: + ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl<T> Default for D<T> { fn default() -> Self { diff --git a/tests/expectations/tests/nested.rs b/tests/expectations/tests/nested.rs index 4022909c..fdca4524 100644 --- a/tests/expectations/tests/nested.rs +++ b/tests/expectations/tests/nested.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -69,7 +72,9 @@ fn bindgen_test_layout_Test_Size() { concat!("Alignment of ", stringify!(Test_Size)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Test_Size>())).mWidth as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Test_Size>())).mWidth as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -79,7 +84,9 @@ fn bindgen_test_layout_Test_Size() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Test_Size>())).mHeight as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Test_Size>())).mHeight as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/nested_vtable.rs b/tests/expectations/tests/nested_vtable.rs index 40826106..e11496e2 100644 --- a/tests/expectations/tests/nested_vtable.rs +++ b/tests/expectations/tests/nested_vtable.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct nsISupports__bindgen_vtable(::std::os::raw::c_void); @@ -31,7 +34,9 @@ impl Default for nsISupports { } extern "C" { #[link_name = "\u{1}_ZN11nsISupports14QueryInterfaceEv"] - pub fn nsISupports_QueryInterface(this: *mut ::std::os::raw::c_void) -> *mut nsISupports; + pub fn nsISupports_QueryInterface( + this: *mut ::std::os::raw::c_void, + ) -> *mut nsISupports; } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/nested_within_namespace.rs b/tests/expectations/tests/nested_within_namespace.rs index 868510e8..e3299305 100644 --- a/tests/expectations/tests/nested_within_namespace.rs +++ b/tests/expectations/tests/nested_within_namespace.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -34,7 +37,9 @@ pub mod root { concat!("Alignment of ", stringify!(Bar_Baz)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar_Baz>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar_Baz>())).foo as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -57,9 +62,16 @@ pub mod root { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).foo as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(foo)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(foo) + ) ); } #[repr(C)] @@ -80,9 +92,16 @@ pub mod root { concat!("Alignment of ", stringify!(Baz)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Baz>())).baz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Baz>())).baz as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Baz), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(Baz), + "::", + stringify!(baz) + ) ); } } diff --git a/tests/expectations/tests/no-comments.rs b/tests/expectations/tests/no-comments.rs index 65f69624..f78bae99 100644 --- a/tests/expectations/tests/no-comments.rs +++ b/tests/expectations/tests/no-comments.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/no-hash-whitelisted.rs b/tests/expectations/tests/no-hash-whitelisted.rs index fd54300d..bcb38b5c 100644 --- a/tests/expectations/tests/no-hash-whitelisted.rs +++ b/tests/expectations/tests/no-hash-whitelisted.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/no-partialeq-whitelisted.rs b/tests/expectations/tests/no-partialeq-whitelisted.rs index 00f7210e..17fec747 100644 --- a/tests/expectations/tests/no-partialeq-whitelisted.rs +++ b/tests/expectations/tests/no-partialeq-whitelisted.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -22,7 +25,9 @@ fn bindgen_test_layout_NoPartialEq() { concat!("Alignment of ", stringify!(NoPartialEq)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<NoPartialEq>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<NoPartialEq>())).i as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/no-std.rs b/tests/expectations/tests/no-std.rs index 524b307a..e884cfb0 100644 --- a/tests/expectations/tests/no-std.rs +++ b/tests/expectations/tests/no-std.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![no_std] mod libc { pub type c_int = i32; diff --git a/tests/expectations/tests/no_copy_whitelisted.rs b/tests/expectations/tests/no_copy_whitelisted.rs index 340fc1ec..74fda3b2 100644 --- a/tests/expectations/tests/no_copy_whitelisted.rs +++ b/tests/expectations/tests/no_copy_whitelisted.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] diff --git a/tests/expectations/tests/non-type-params.rs b/tests/expectations/tests/non-type-params.rs index 4ba64257..50b3a273 100644 --- a/tests/expectations/tests/non-type-params.rs +++ b/tests/expectations/tests/non-type-params.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type Array16 = u8; pub type ArrayInt4 = [u32; 4usize]; @@ -26,7 +29,10 @@ fn bindgen_test_layout_UsesArray() { concat!("Alignment of ", stringify!(UsesArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UsesArray>())).array_char_16 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UsesArray>())).array_char_16 as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -36,7 +42,10 @@ fn bindgen_test_layout_UsesArray() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UsesArray>())).array_bool_8 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UsesArray>())).array_bool_8 as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -46,7 +55,10 @@ fn bindgen_test_layout_UsesArray() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UsesArray>())).array_int_4 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UsesArray>())).array_int_4 as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/nsBaseHashtable.rs b/tests/expectations/tests/nsBaseHashtable.rs index 338978e1..8006c92e 100644 --- a/tests/expectations/tests/nsBaseHashtable.rs +++ b/tests/expectations/tests/nsBaseHashtable.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/tests/expectations/tests/nsStyleAutoArray.rs index bd5e7f4b..fc1b4f32 100644 --- a/tests/expectations/tests/nsStyleAutoArray.rs +++ b/tests/expectations/tests/nsStyleAutoArray.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/objc_category.rs b/tests/expectations/tests/objc_category.rs index ba37b819..48970fde 100644 --- a/tests/expectations/tests/objc_category.rs +++ b/tests/expectations/tests/objc_category.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_class.rs b/tests/expectations/tests/objc_class.rs index 062cab3f..e312f7a5 100644 --- a/tests/expectations/tests/objc_class.rs +++ b/tests/expectations/tests/objc_class.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_class_method.rs b/tests/expectations/tests/objc_class_method.rs index a365024e..42245b99 100644 --- a/tests/expectations/tests/objc_class_method.rs +++ b/tests/expectations/tests/objc_class_method.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_interface.rs b/tests/expectations/tests/objc_interface.rs index e8c1278a..b49f21f7 100644 --- a/tests/expectations/tests/objc_interface.rs +++ b/tests/expectations/tests/objc_interface.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_interface_type.rs b/tests/expectations/tests/objc_interface_type.rs index 0b77b5be..5868aa7f 100644 --- a/tests/expectations/tests/objc_interface_type.rs +++ b/tests/expectations/tests/objc_interface_type.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] @@ -28,7 +32,9 @@ fn bindgen_test_layout_FooStruct() { concat!("Alignment of ", stringify!(FooStruct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<FooStruct>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<FooStruct>())).foo as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/objc_method.rs b/tests/expectations/tests/objc_method.rs index bd6e748a..2c61aa23 100644 --- a/tests/expectations/tests/objc_method.rs +++ b/tests/expectations/tests/objc_method.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_method_clash.rs b/tests/expectations/tests/objc_method_clash.rs index 10e7d544..739d2aa9 100644 --- a/tests/expectations/tests/objc_method_clash.rs +++ b/tests/expectations/tests/objc_method_clash.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_property_fnptr.rs b/tests/expectations/tests/objc_property_fnptr.rs index 94ebfad6..a1c4b3d2 100644 --- a/tests/expectations/tests/objc_property_fnptr.rs +++ b/tests/expectations/tests/objc_property_fnptr.rs @@ -24,7 +24,9 @@ pub trait Foo { >; unsafe fn setFunc_( self, - func: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>, + func: ::std::option::Option< + unsafe extern "C" fn() -> ::std::os::raw::c_int, + >, ); } impl Foo for id { @@ -41,7 +43,9 @@ impl Foo for id { } unsafe fn setFunc_( self, - func: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>, + func: ::std::option::Option< + unsafe extern "C" fn() -> ::std::os::raw::c_int, + >, ) { msg_send!(self, setFunc: func) } diff --git a/tests/expectations/tests/objc_protocol.rs b/tests/expectations/tests/objc_protocol.rs index 33a81fa4..aeb6de02 100644 --- a/tests/expectations/tests/objc_protocol.rs +++ b/tests/expectations/tests/objc_protocol.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_sel_and_id.rs b/tests/expectations/tests/objc_sel_and_id.rs index da69c7a8..b4857563 100644 --- a/tests/expectations/tests/objc_sel_and_id.rs +++ b/tests/expectations/tests/objc_sel_and_id.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] diff --git a/tests/expectations/tests/objc_whitelist.rs b/tests/expectations/tests/objc_whitelist.rs index eba2b298..3089fb7f 100644 --- a/tests/expectations/tests/objc_whitelist.rs +++ b/tests/expectations/tests/objc_whitelist.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(target_os = "macos")] #[macro_use] @@ -17,7 +22,8 @@ impl protocol_SomeProtocol for id { } unsafe fn protocolClassMethod() { msg_send!( - objc::runtime::Class::get("SomeProtocol").expect("Couldn't find SomeProtocol"), + objc::runtime::Class::get("SomeProtocol") + .expect("Couldn't find SomeProtocol"), protocolClassMethod ) } @@ -32,7 +38,8 @@ impl WhitelistMe for id { } unsafe fn classMethod() { msg_send!( - objc::runtime::Class::get("WhitelistMe").expect("Couldn't find WhitelistMe"), + objc::runtime::Class::get("WhitelistMe") + .expect("Couldn't find WhitelistMe"), classMethod ) } diff --git a/tests/expectations/tests/only_bitfields.rs b/tests/expectations/tests/only_bitfields.rs index b5db31af..24721b60 100644 --- a/tests/expectations/tests/only_bitfields.rs +++ b/tests/expectations/tests/only_bitfields.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -109,7 +115,9 @@ fn bindgen_test_layout_C() { impl C { #[inline] pub fn a(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) + } } #[inline] pub fn set_a(&mut self, val: bool) { @@ -120,7 +128,9 @@ impl C { } #[inline] pub fn b(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) + } } #[inline] pub fn set_b(&mut self, val: bool) { @@ -130,9 +140,14 @@ impl C { } } #[inline] - pub fn new_bitfield_1(a: bool, b: bool) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + a: bool, + b: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u8 = unsafe { ::std::mem::transmute(a) }; a as u64 diff --git a/tests/expectations/tests/opaque-template-inst-member-2.rs b/tests/expectations/tests/opaque-template-inst-member-2.rs index b5afc667..2054397c 100644 --- a/tests/expectations/tests/opaque-template-inst-member-2.rs +++ b/tests/expectations/tests/opaque-template-inst-member-2.rs @@ -34,7 +34,10 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { concat!("Alignment of ", stringify!(ContainsOpaqueTemplate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBlah as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBlah as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -44,7 +47,10 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBaz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBaz as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -74,7 +80,10 @@ fn bindgen_test_layout_InheritsOpaqueTemplate() { concat!("Alignment of ", stringify!(InheritsOpaqueTemplate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<InheritsOpaqueTemplate>())).wow as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<InheritsOpaqueTemplate>())).wow as *const _ + as usize + }, 8usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/opaque-template-inst-member.rs b/tests/expectations/tests/opaque-template-inst-member.rs index 87e98daf..66a2f049 100644 --- a/tests/expectations/tests/opaque-template-inst-member.rs +++ b/tests/expectations/tests/opaque-template-inst-member.rs @@ -32,7 +32,10 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { concat!("Alignment of ", stringify!(ContainsOpaqueTemplate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBlah as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBlah as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +45,10 @@ fn bindgen_test_layout_ContainsOpaqueTemplate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBaz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContainsOpaqueTemplate>())).mBaz as *const _ + as usize + }, 404usize, concat!( "Offset of field: ", @@ -82,7 +88,10 @@ fn bindgen_test_layout_InheritsOpaqueTemplate() { concat!("Alignment of ", stringify!(InheritsOpaqueTemplate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<InheritsOpaqueTemplate>())).wow as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<InheritsOpaqueTemplate>())).wow as *const _ + as usize + }, 408usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs index 4f5b0cb9..ff9d8944 100644 --- a/tests/expectations/tests/opaque-template-instantiation-namespaced.rs +++ b/tests/expectations/tests/opaque-template-instantiation-namespaced.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -15,7 +18,8 @@ pub mod root { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Template<T> { pub member: T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: + ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl<T> Default for Template<T> { fn default() -> Self { @@ -40,9 +44,16 @@ pub mod root { concat!("Alignment of ", stringify!(Foo)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Foo>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Foo>())).c as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Foo), "::", stringify!(c)) + concat!( + "Offset of field: ", + stringify!(Foo), + "::", + stringify!(c) + ) ); } #[repr(C)] @@ -63,9 +74,16 @@ pub mod root { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).i as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).i as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(i)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(i) + ) ); } #[repr(C)] @@ -87,8 +105,8 @@ pub mod root { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContainsInstantiation>())).not_opaque as *const _ - as usize + &(*(::std::ptr::null::<ContainsInstantiation>())).not_opaque + as *const _ as usize }, 0usize, concat!( @@ -119,12 +137,15 @@ pub mod root { assert_eq!( ::std::mem::align_of::<ContainsOpaqueInstantiation>(), 4usize, - concat!("Alignment of ", stringify!(ContainsOpaqueInstantiation)) + concat!( + "Alignment of ", + stringify!(ContainsOpaqueInstantiation) + ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContainsOpaqueInstantiation>())).opaque as *const _ - as usize + &(*(::std::ptr::null::<ContainsOpaqueInstantiation>())) + .opaque as *const _ as usize }, 0usize, concat!( @@ -139,7 +160,8 @@ pub mod root { #[test] fn __bindgen_test_layout_Template_open0_Foo_close0_instantiation() { assert_eq!( - ::std::mem::size_of::<root::zoidberg::Template<root::zoidberg::Foo>>(), + ::std::mem::size_of::<root::zoidberg::Template<root::zoidberg::Foo>>( + ), 1usize, concat!( "Size of template specialization: ", @@ -147,7 +169,8 @@ pub mod root { ) ); assert_eq!( - ::std::mem::align_of::<root::zoidberg::Template<root::zoidberg::Foo>>(), + ::std::mem::align_of::<root::zoidberg::Template<root::zoidberg::Foo>>( + ), 1usize, concat!( "Alignment of template specialization: ", diff --git a/tests/expectations/tests/opaque-template-instantiation.rs b/tests/expectations/tests/opaque-template-instantiation.rs index c3043abf..67828313 100644 --- a/tests/expectations/tests/opaque-template-instantiation.rs +++ b/tests/expectations/tests/opaque-template-instantiation.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -34,7 +37,8 @@ fn bindgen_test_layout_ContainsInstantiation() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContainsInstantiation>())).not_opaque as *const _ as usize + &(*(::std::ptr::null::<ContainsInstantiation>())).not_opaque + as *const _ as usize }, 0usize, concat!( @@ -69,7 +73,8 @@ fn bindgen_test_layout_ContainsOpaqueInstantiation() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<ContainsOpaqueInstantiation>())).opaque as *const _ as usize + &(*(::std::ptr::null::<ContainsOpaqueInstantiation>())).opaque + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/opaque_in_struct.rs b/tests/expectations/tests/opaque_in_struct.rs index 9301f7ab..0209e5b0 100644 --- a/tests/expectations/tests/opaque_in_struct.rs +++ b/tests/expectations/tests/opaque_in_struct.rs @@ -45,7 +45,9 @@ fn bindgen_test_layout_container() { concat!("Alignment of ", stringify!(container)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<container>())).contained as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<container>())).contained as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs index 3ec96214..1d79906d 100644 --- a/tests/expectations/tests/opaque_pointer.rs +++ b/tests/expectations/tests/opaque_pointer.rs @@ -53,7 +53,10 @@ fn bindgen_test_layout_WithOpaquePtr() { concat!("Alignment of ", stringify!(WithOpaquePtr)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithOpaquePtr>())).whatever as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithOpaquePtr>())).whatever as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -63,7 +66,9 @@ fn bindgen_test_layout_WithOpaquePtr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithOpaquePtr>())).other as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithOpaquePtr>())).other as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -73,7 +78,9 @@ fn bindgen_test_layout_WithOpaquePtr() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithOpaquePtr>())).t as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithOpaquePtr>())).t as *const _ as usize + }, 12usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/overflowed_enum.rs b/tests/expectations/tests/overflowed_enum.rs index 25e91786..31b88621 100644 --- a/tests/expectations/tests/overflowed_enum.rs +++ b/tests/expectations/tests/overflowed_enum.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/overloading.rs b/tests/expectations/tests/overloading.rs index 28b783c3..ae16f14c 100644 --- a/tests/expectations/tests/overloading.rs +++ b/tests/expectations/tests/overloading.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { #[link_name = "\u{1}_Z8Evaluatec"] @@ -10,7 +13,10 @@ extern "C" { } extern "C" { #[link_name = "\u{1}_Z8Evaluateii"] - pub fn Evaluate1(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool; + pub fn Evaluate1( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> bool; } extern "C" { #[link_name = "\u{1}_ZN3foo10MyFunctionEv"] diff --git a/tests/expectations/tests/prepend_enum_name.rs b/tests/expectations/tests/prepend_enum_name.rs index 96c7b617..1c88438b 100644 --- a/tests/expectations/tests/prepend_enum_name.rs +++ b/tests/expectations/tests/prepend_enum_name.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const FOO_BAR: foo = 0; pub const FOO_BAZ: foo = 1; diff --git a/tests/expectations/tests/private.rs b/tests/expectations/tests/private.rs index 5088d9c9..618e68c0 100644 --- a/tests/expectations/tests/private.rs +++ b/tests/expectations/tests/private.rs @@ -27,7 +27,10 @@ fn bindgen_test_layout_HasPrivate() { concat!("Alignment of ", stringify!(HasPrivate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<HasPrivate>())).mNotPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<HasPrivate>())).mNotPrivate as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -37,7 +40,10 @@ fn bindgen_test_layout_HasPrivate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<HasPrivate>())).mIsPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<HasPrivate>())).mIsPrivate as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -67,7 +73,10 @@ fn bindgen_test_layout_VeryPrivate() { concat!("Alignment of ", stringify!(VeryPrivate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<VeryPrivate>())).mIsPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<VeryPrivate>())).mIsPrivate as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -77,7 +86,10 @@ fn bindgen_test_layout_VeryPrivate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<VeryPrivate>())).mIsAlsoPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<VeryPrivate>())).mIsAlsoPrivate as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", @@ -108,7 +120,10 @@ fn bindgen_test_layout_ContradictPrivate() { concat!("Alignment of ", stringify!(ContradictPrivate)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContradictPrivate>())).mNotPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContradictPrivate>())).mNotPrivate + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -118,7 +133,10 @@ fn bindgen_test_layout_ContradictPrivate() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContradictPrivate>())).mIsPrivate as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContradictPrivate>())).mIsPrivate as *const _ + as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/public-dtor.rs b/tests/expectations/tests/public-dtor.rs index f551c2cb..55b289df 100644 --- a/tests/expectations/tests/public-dtor.rs +++ b/tests/expectations/tests/public-dtor.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] diff --git a/tests/expectations/tests/redeclaration.rs b/tests/expectations/tests/redeclaration.rs index 87df5e4a..90dc8d46 100644 --- a/tests/expectations/tests/redeclaration.rs +++ b/tests/expectations/tests/redeclaration.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { pub fn foo(); diff --git a/tests/expectations/tests/ref_argument_array.rs b/tests/expectations/tests/ref_argument_array.rs index 89ae83c9..d31c7743 100644 --- a/tests/expectations/tests/ref_argument_array.rs +++ b/tests/expectations/tests/ref_argument_array.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const NSID_LENGTH: u32 = 10; #[repr(C)] diff --git a/tests/expectations/tests/reparented_replacement.rs b/tests/expectations/tests/reparented_replacement.rs index 8fc38cd7..bfc65feb 100644 --- a/tests/expectations/tests/reparented_replacement.rs +++ b/tests/expectations/tests/reparented_replacement.rs @@ -33,9 +33,16 @@ pub mod root { concat!("Alignment of ", stringify!(Bar)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Bar>())).bazz as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Bar>())).bazz as *const _ as usize + }, 0usize, - concat!("Offset of field: ", stringify!(Bar), "::", stringify!(bazz)) + concat!( + "Offset of field: ", + stringify!(Bar), + "::", + stringify!(bazz) + ) ); } } diff --git a/tests/expectations/tests/resolved_type_def_function.rs b/tests/expectations/tests/resolved_type_def_function.rs index f400c9fe..bf748920 100644 --- a/tests/expectations/tests/resolved_type_def_function.rs +++ b/tests/expectations/tests/resolved_type_def_function.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type FuncType = ::std::option::Option<unsafe extern "C" fn()>; extern "C" { diff --git a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs index 9a8c1efa..166abffb 100644 --- a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs +++ b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -26,7 +31,9 @@ fn bindgen_test_layout_JS_shadow_Zone() { concat!("Alignment of ", stringify!(JS_shadow_Zone)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<JS_shadow_Zone>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<JS_shadow_Zone>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -36,7 +43,9 @@ fn bindgen_test_layout_JS_shadow_Zone() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<JS_shadow_Zone>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<JS_shadow_Zone>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/sentry-defined-multiple-times.rs b/tests/expectations/tests/sentry-defined-multiple-times.rs index 7f96b450..47773a48 100644 --- a/tests/expectations/tests/sentry-defined-multiple-times.rs +++ b/tests/expectations/tests/sentry-defined-multiple-times.rs @@ -43,7 +43,8 @@ pub mod root { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<sentry>())).i_am_plain_sentry as *const _ as usize + &(*(::std::ptr::null::<sentry>())).i_am_plain_sentry + as *const _ as usize }, 0usize, concat!( @@ -92,7 +93,8 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<NotTemplateWrapper_sentry>())) - .i_am_not_template_wrapper_sentry as *const _ as usize + .i_am_not_template_wrapper_sentry + as *const _ as usize }, 0usize, concat!( @@ -118,18 +120,24 @@ pub mod root { assert_eq!( ::std::mem::size_of::<InlineNotTemplateWrapper_sentry>(), 1usize, - concat!("Size of: ", stringify!(InlineNotTemplateWrapper_sentry)) + concat!( + "Size of: ", + stringify!(InlineNotTemplateWrapper_sentry) + ) ); assert_eq!( ::std::mem::align_of::<InlineNotTemplateWrapper_sentry>(), 1usize, - concat!("Alignment of ", stringify!(InlineNotTemplateWrapper_sentry)) + concat!( + "Alignment of ", + stringify!(InlineNotTemplateWrapper_sentry) + ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<InlineNotTemplateWrapper_sentry>())) - .i_am_inline_not_template_wrapper_sentry as *const _ - as usize + .i_am_inline_not_template_wrapper_sentry + as *const _ as usize }, 0usize, concat!( @@ -213,7 +221,9 @@ pub mod root { #[test] fn bindgen_test_layout_OuterDoubleWrapper_InnerDoubleWrapper_sentry() { assert_eq!( - ::std::mem::size_of::<OuterDoubleWrapper_InnerDoubleWrapper_sentry>(), + ::std::mem::size_of::< + OuterDoubleWrapper_InnerDoubleWrapper_sentry, + >(), 4usize, concat!( "Size of: ", @@ -221,7 +231,9 @@ pub mod root { ) ); assert_eq!( - ::std::mem::align_of::<OuterDoubleWrapper_InnerDoubleWrapper_sentry>(), + ::std::mem::align_of::< + OuterDoubleWrapper_InnerDoubleWrapper_sentry, + >(), 4usize, concat!( "Alignment of ", @@ -230,8 +242,11 @@ pub mod root { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<OuterDoubleWrapper_InnerDoubleWrapper_sentry>())) - .i_am_double_wrapper_sentry as *const _ as usize + &(*(::std::ptr::null::< + OuterDoubleWrapper_InnerDoubleWrapper_sentry, + >())) + .i_am_double_wrapper_sentry as *const _ + as usize }, 0usize, concat!( @@ -258,52 +273,37 @@ pub mod root { pub i_am_double_wrapper_inline_sentry: ::std::os::raw::c_int, } #[test] - fn bindgen_test_layout_OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry() { - assert_eq!( - ::std::mem::size_of::<OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry>(), - 4usize, - concat!( - "Size of: ", - stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry) - ) - ); - assert_eq!( - ::std::mem::align_of::<OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry>(), - 4usize, - concat!( - "Alignment of ", - stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry) - ) - ); - assert_eq!( - unsafe { - & ( * ( :: std :: ptr :: null :: < OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry > ( ) ) ) . i_am_double_wrapper_inline_sentry as * const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry), - "::", - stringify!(i_am_double_wrapper_inline_sentry) - ) - ); + fn bindgen_test_layout_OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry( + ) { + assert_eq ! ( :: std :: mem :: size_of :: < OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry ) ) ); + assert_eq ! ( :: std :: mem :: align_of :: < OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry ) ) ); + assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry > ( ) ) ) . i_am_double_wrapper_inline_sentry as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( OuterDoubleInlineWrapper_InnerDoubleInlineWrapper_sentry ) , "::" , stringify ! ( i_am_double_wrapper_inline_sentry ) ) ); } #[test] - fn bindgen_test_layout_OuterDoubleInlineWrapper_InnerDoubleInlineWrapper() { + fn bindgen_test_layout_OuterDoubleInlineWrapper_InnerDoubleInlineWrapper( + ) { assert_eq!( - ::std::mem::size_of::<OuterDoubleInlineWrapper_InnerDoubleInlineWrapper>(), + ::std::mem::size_of::< + OuterDoubleInlineWrapper_InnerDoubleInlineWrapper, + >(), 1usize, concat!( "Size of: ", - stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper) + stringify!( + OuterDoubleInlineWrapper_InnerDoubleInlineWrapper + ) ) ); assert_eq!( - ::std::mem::align_of::<OuterDoubleInlineWrapper_InnerDoubleInlineWrapper>(), + ::std::mem::align_of::< + OuterDoubleInlineWrapper_InnerDoubleInlineWrapper, + >(), 1usize, concat!( "Alignment of ", - stringify!(OuterDoubleInlineWrapper_InnerDoubleInlineWrapper) + stringify!( + OuterDoubleInlineWrapper_InnerDoubleInlineWrapper + ) ) ); } @@ -350,8 +350,8 @@ pub mod root { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<sentry>())).i_am_outside_namespace_sentry as *const _ - as usize + &(*(::std::ptr::null::<sentry>())).i_am_outside_namespace_sentry + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/short-enums.rs b/tests/expectations/tests/short-enums.rs index a7739f21..835a7ac8 100644 --- a/tests/expectations/tests/short-enums.rs +++ b/tests/expectations/tests/short-enums.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] diff --git a/tests/expectations/tests/size_t_template.rs b/tests/expectations/tests/size_t_template.rs index 8bc54300..fde0174a 100644 --- a/tests/expectations/tests/size_t_template.rs +++ b/tests/expectations/tests/size_t_template.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/tests/expectations/tests/struct_containing_forward_declared_struct.rs index de2efda5..bf79ee0e 100644 --- a/tests/expectations/tests/struct_containing_forward_declared_struct.rs +++ b/tests/expectations/tests/struct_containing_forward_declared_struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/struct_typedef.rs b/tests/expectations/tests/struct_typedef.rs index f85aeb4c..47505e50 100644 --- a/tests/expectations/tests/struct_typedef.rs +++ b/tests/expectations/tests/struct_typedef.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -20,7 +25,10 @@ fn bindgen_test_layout_typedef_named_struct() { concat!("Alignment of ", stringify!(typedef_named_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<typedef_named_struct>())).has_name as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<typedef_named_struct>())).has_name + as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -48,7 +56,10 @@ fn bindgen_test_layout__bindgen_ty_1() { concat!("Alignment of ", stringify!(_bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_bindgen_ty_1>())).no_name as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_bindgen_ty_1>())).no_name as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_typedef_ns.rs b/tests/expectations/tests/struct_typedef_ns.rs index 79fa38de..1a975777 100644 --- a/tests/expectations/tests/struct_typedef_ns.rs +++ b/tests/expectations/tests/struct_typedef_ns.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -27,7 +32,10 @@ pub mod root { concat!("Alignment of ", stringify!(typedef_struct)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<typedef_struct>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<typedef_struct>())).foo as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -64,7 +72,10 @@ pub mod root { concat!("Alignment of ", stringify!(_bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_bindgen_ty_1>())).foo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_bindgen_ty_1>())).foo as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -75,8 +86,8 @@ pub mod root { ); } 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 = - _bindgen_ty_2::BAR; + 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 { diff --git a/tests/expectations/tests/struct_with_anon_struct.rs b/tests/expectations/tests/struct_with_anon_struct.rs index 5dcdaf8c..5a631008 100644 --- a/tests/expectations/tests/struct_with_anon_struct.rs +++ b/tests/expectations/tests/struct_with_anon_struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -28,7 +31,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +43,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_struct_array.rs b/tests/expectations/tests/struct_with_anon_struct_array.rs index 7af227a1..72616471 100644 --- a/tests/expectations/tests/struct_with_anon_struct_array.rs +++ b/tests/expectations/tests/struct_with_anon_struct_array.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -29,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -39,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -68,7 +75,9 @@ fn bindgen_test_layout_foo__bindgen_ty_2() { concat!("Alignment of ", stringify!(foo__bindgen_ty_2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_2>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_2>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -78,7 +87,9 @@ fn bindgen_test_layout_foo__bindgen_ty_2() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_2>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_2>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/tests/expectations/tests/struct_with_anon_struct_pointer.rs index 906ff469..e5bd27fd 100644 --- a/tests/expectations/tests/struct_with_anon_struct_pointer.rs +++ b/tests/expectations/tests/struct_with_anon_struct_pointer.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -28,7 +31,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +43,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_union.rs b/tests/expectations/tests/struct_with_anon_union.rs index d0328d34..b630c54c 100644 --- a/tests/expectations/tests/struct_with_anon_union.rs +++ b/tests/expectations/tests/struct_with_anon_union.rs @@ -32,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_union_1_0.rs b/tests/expectations/tests/struct_with_anon_union_1_0.rs index 88e27efe..ed6450af 100644 --- a/tests/expectations/tests/struct_with_anon_union_1_0.rs +++ b/tests/expectations/tests/struct_with_anon_union_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -72,7 +75,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -82,7 +87,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs index b2baff93..a304dbb9 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -28,7 +31,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +43,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/tests/expectations/tests/struct_with_anon_unnamed_union.rs index abb0bd3f..6e34fa29 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_union.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_union.rs @@ -32,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs b/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs index 43ff66bc..b2b6923d 100644 --- a/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs +++ b/tests/expectations/tests/struct_with_anon_unnamed_union_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -72,7 +75,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -82,7 +87,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_bitfields.rs b/tests/expectations/tests/struct_with_bitfields.rs index 3f99eb02..0a856469 100644 --- a/tests/expectations/tests/struct_with_bitfields.rs +++ b/tests/expectations/tests/struct_with_bitfields.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -121,7 +127,9 @@ fn bindgen_test_layout_bitfield() { impl bitfield { #[inline] pub fn a(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) + } } #[inline] pub fn set_a(&mut self, val: ::std::os::raw::c_ushort) { @@ -132,7 +140,9 @@ impl bitfield { } #[inline] pub fn b(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) + } } #[inline] pub fn set_b(&mut self, val: ::std::os::raw::c_ushort) { @@ -143,7 +153,9 @@ impl bitfield { } #[inline] pub fn c(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) + } } #[inline] pub fn set_c(&mut self, val: ::std::os::raw::c_ushort) { @@ -154,7 +166,9 @@ impl bitfield { } #[inline] pub fn d(&self) -> ::std::os::raw::c_ushort { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u16) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u16) + } } #[inline] pub fn set_d(&mut self, val: ::std::os::raw::c_ushort) { @@ -170,8 +184,10 @@ impl bitfield { c: ::std::os::raw::c_ushort, d: ::std::os::raw::c_ushort, ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let a: u16 = unsafe { ::std::mem::transmute(a) }; a as u64 @@ -192,7 +208,9 @@ impl bitfield { } #[inline] pub fn f(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 2u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(0usize, 2u8) as u32) + } } #[inline] pub fn set_f(&mut self, val: ::std::os::raw::c_uint) { @@ -203,7 +221,9 @@ impl bitfield { } #[inline] pub fn g(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_2.get(32usize, 32u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(32usize, 32u8) as u32) + } } #[inline] pub fn set_g(&mut self, val: ::std::os::raw::c_uint) { @@ -217,8 +237,10 @@ impl bitfield { f: ::std::os::raw::c_uint, g: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 8usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 8usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 2u8, { let f: u32 = unsafe { ::std::mem::transmute(f) }; f as u64 diff --git a/tests/expectations/tests/struct_with_derive_debug.rs b/tests/expectations/tests/struct_with_derive_debug.rs index 205e565d..73c7e4ff 100644 --- a/tests/expectations/tests/struct_with_derive_debug.rs +++ b/tests/expectations/tests/struct_with_derive_debug.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -22,7 +25,9 @@ fn bindgen_test_layout_LittleArray() { concat!("Alignment of ", stringify!(LittleArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<LittleArray>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<LittleArray>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -83,7 +88,9 @@ fn bindgen_test_layout_WithLittleArray() { concat!("Alignment of ", stringify!(WithLittleArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithLittleArray>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithLittleArray>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -111,7 +118,9 @@ fn bindgen_test_layout_WithBigArray() { concat!("Alignment of ", stringify!(WithBigArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_large_array.rs b/tests/expectations/tests/struct_with_large_array.rs index 43388eda..5321aa10 100644 --- a/tests/expectations/tests/struct_with_large_array.rs +++ b/tests/expectations/tests/struct_with_large_array.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Copy, Clone)] @@ -22,7 +25,9 @@ fn bindgen_test_layout_S() { concat!("Alignment of ", stringify!(S)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<S>())).large_array as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<S>())).large_array as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_nesting.rs b/tests/expectations/tests/struct_with_nesting.rs index 73787d86..872c1476 100644 --- a/tests/expectations/tests/struct_with_nesting.rs +++ b/tests/expectations/tests/struct_with_nesting.rs @@ -41,7 +41,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c1 + as *const _ as usize }, 0usize, concat!( @@ -53,7 +54,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c2 + as *const _ as usize }, 2usize, concat!( @@ -86,7 +88,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d1 + as *const _ as usize }, 0usize, concat!( @@ -98,7 +101,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d2 + as *const _ as usize }, 1usize, concat!( @@ -110,7 +114,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d3 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d3 + as *const _ as usize }, 2usize, concat!( @@ -122,7 +127,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d4 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d4 + as *const _ as usize }, 3usize, concat!( @@ -146,7 +152,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_nesting_1_0.rs b/tests/expectations/tests/struct_with_nesting_1_0.rs index 569a7b81..221215b2 100644 --- a/tests/expectations/tests/struct_with_nesting_1_0.rs +++ b/tests/expectations/tests/struct_with_nesting_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -81,7 +84,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c1 + as *const _ as usize }, 0usize, concat!( @@ -93,7 +97,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).c2 + as *const _ as usize }, 2usize, concat!( @@ -131,7 +136,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d1 + as *const _ as usize }, 0usize, concat!( @@ -143,7 +149,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d2 + as *const _ as usize }, 1usize, concat!( @@ -155,7 +162,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d3 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d3 + as *const _ as usize }, 2usize, concat!( @@ -167,7 +175,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d4 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).d4 + as *const _ as usize }, 3usize, concat!( @@ -196,7 +205,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_packing.rs b/tests/expectations/tests/struct_with_packing.rs index 410d8f4a..20123498 100644 --- a/tests/expectations/tests/struct_with_packing.rs +++ b/tests/expectations/tests/struct_with_packing.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/struct_with_struct.rs b/tests/expectations/tests/struct_with_struct.rs index 95d66bf8..9ed9454f 100644 --- a/tests/expectations/tests/struct_with_struct.rs +++ b/tests/expectations/tests/struct_with_struct.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] @@ -28,7 +31,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +43,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).y as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).y as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/struct_with_typedef_template_arg.rs b/tests/expectations/tests/struct_with_typedef_template_arg.rs index 2c21656a..8b617ca4 100644 --- a/tests/expectations/tests/struct_with_typedef_template_arg.rs +++ b/tests/expectations/tests/struct_with_typedef_template_arg.rs @@ -1,12 +1,16 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Proxy { pub _address: u8, } -pub type Proxy_foo<T> = ::std::option::Option<unsafe extern "C" fn(bar: *mut T)>; +pub type Proxy_foo<T> = + ::std::option::Option<unsafe extern "C" fn(bar: *mut T)>; diff --git a/tests/expectations/tests/template-fun-ty.rs b/tests/expectations/tests/template-fun-ty.rs index cce6c24d..225099fa 100644 --- a/tests/expectations/tests/template-fun-ty.rs +++ b/tests/expectations/tests/template-fun-ty.rs @@ -1,15 +1,19 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Foo { pub _address: u8, } -pub type Foo_FunctionPtr<T> = ::std::option::Option<unsafe extern "C" fn() -> T>; +pub type Foo_FunctionPtr<T> = + ::std::option::Option<unsafe extern "C" fn() -> T>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct RefPtr { @@ -20,7 +24,6 @@ pub struct RefPtr { pub struct RefPtr_Proxy { pub _address: u8, } -pub type RefPtr_Proxy_member_function<R, Args> = ::std::option::Option< - unsafe extern "C" fn(arg1: Args) -> R, ->; +pub type RefPtr_Proxy_member_function<R, Args> = + ::std::option::Option<unsafe extern "C" fn(arg1: Args) -> R>; pub type Returner<T> = ::std::option::Option<unsafe extern "C" fn() -> T>; diff --git a/tests/expectations/tests/template-param-usage-0.rs b/tests/expectations/tests/template-param-usage-0.rs index d5ca7d7d..adc8219d 100644 --- a/tests/expectations/tests/template-param-usage-0.rs +++ b/tests/expectations/tests/template-param-usage-0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-1.rs b/tests/expectations/tests/template-param-usage-1.rs index 95e41077..ec8ad32c 100644 --- a/tests/expectations/tests/template-param-usage-1.rs +++ b/tests/expectations/tests/template-param-usage-1.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-10.rs b/tests/expectations/tests/template-param-usage-10.rs index 940be664..ced48333 100644 --- a/tests/expectations/tests/template-param-usage-10.rs +++ b/tests/expectations/tests/template-param-usage-10.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-11.rs b/tests/expectations/tests/template-param-usage-11.rs index 1b2335bb..d2263738 100644 --- a/tests/expectations/tests/template-param-usage-11.rs +++ b/tests/expectations/tests/template-param-usage-11.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-12.rs b/tests/expectations/tests/template-param-usage-12.rs index d6a54085..c0391faf 100644 --- a/tests/expectations/tests/template-param-usage-12.rs +++ b/tests/expectations/tests/template-param-usage-12.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-13.rs b/tests/expectations/tests/template-param-usage-13.rs index 855c76fe..50b40a8b 100644 --- a/tests/expectations/tests/template-param-usage-13.rs +++ b/tests/expectations/tests/template-param-usage-13.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-14.rs b/tests/expectations/tests/template-param-usage-14.rs index 97dbba46..d093fd73 100644 --- a/tests/expectations/tests/template-param-usage-14.rs +++ b/tests/expectations/tests/template-param-usage-14.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-15.rs b/tests/expectations/tests/template-param-usage-15.rs index 405e8198..25792de0 100644 --- a/tests/expectations/tests/template-param-usage-15.rs +++ b/tests/expectations/tests/template-param-usage-15.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-2.rs b/tests/expectations/tests/template-param-usage-2.rs index 24086724..1f40e41e 100644 --- a/tests/expectations/tests/template-param-usage-2.rs +++ b/tests/expectations/tests/template-param-usage-2.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-3.rs b/tests/expectations/tests/template-param-usage-3.rs index 0e5d2fdf..5564af89 100644 --- a/tests/expectations/tests/template-param-usage-3.rs +++ b/tests/expectations/tests/template-param-usage-3.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -18,7 +21,9 @@ pub struct UsesTemplateParameter_AlsoUsesTemplateParameterAndMore<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 UsesTemplateParameter_AlsoUsesTemplateParameterAndMore<T, U> { +impl<T, U> Default + for UsesTemplateParameter_AlsoUsesTemplateParameterAndMore<T, U> +{ fn default() -> Self { unsafe { ::std::mem::zeroed() } } diff --git a/tests/expectations/tests/template-param-usage-4.rs b/tests/expectations/tests/template-param-usage-4.rs index af36754f..35af5bef 100644 --- a/tests/expectations/tests/template-param-usage-4.rs +++ b/tests/expectations/tests/template-param-usage-4.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-5.rs b/tests/expectations/tests/template-param-usage-5.rs index 46ae3513..218264fe 100644 --- a/tests/expectations/tests/template-param-usage-5.rs +++ b/tests/expectations/tests/template-param-usage-5.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-6.rs b/tests/expectations/tests/template-param-usage-6.rs index f76e6326..d6f5a14a 100644 --- a/tests/expectations/tests/template-param-usage-6.rs +++ b/tests/expectations/tests/template-param-usage-6.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-7.rs b/tests/expectations/tests/template-param-usage-7.rs index b30c82b4..71a5de1f 100644 --- a/tests/expectations/tests/template-param-usage-7.rs +++ b/tests/expectations/tests/template-param-usage-7.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-8.rs b/tests/expectations/tests/template-param-usage-8.rs index 75e14706..9ea1ae68 100644 --- a/tests/expectations/tests/template-param-usage-8.rs +++ b/tests/expectations/tests/template-param-usage-8.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/template-param-usage-9.rs b/tests/expectations/tests/template-param-usage-9.rs index 3071924e..2e109f19 100644 --- a/tests/expectations/tests/template-param-usage-9.rs +++ b/tests/expectations/tests/template-param-usage-9.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template-with-var.rs b/tests/expectations/tests/template-with-var.rs index 0b0a8cb6..36d54049 100644 --- a/tests/expectations/tests/template-with-var.rs +++ b/tests/expectations/tests/template-with-var.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs index c0152972..294ee980 100644 --- a/tests/expectations/tests/template.rs +++ b/tests/expectations/tests/template.rs @@ -77,7 +77,9 @@ fn bindgen_test_layout_C() { concat!("Offset of field: ", stringify!(C), "::", stringify!(mB)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstPtr as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -87,7 +89,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstStructPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstStructPtr as *const _ as usize + }, 16usize, concat!( "Offset of field: ", @@ -97,7 +101,10 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstStructPtrArray as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstStructPtrArray as *const _ + as usize + }, 24usize, concat!( "Offset of field: ", @@ -117,7 +124,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBVolatile as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBVolatile as *const _ as usize + }, 36usize, concat!( "Offset of field: ", @@ -127,7 +136,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstBool as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstBool as *const _ as usize + }, 40usize, concat!( "Offset of field: ", @@ -137,7 +148,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstChar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstChar as *const _ as usize + }, 42usize, concat!( "Offset of field: ", @@ -157,7 +170,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBPtrArray as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBPtrArray as *const _ as usize + }, 48usize, concat!( "Offset of field: ", @@ -167,7 +182,9 @@ fn bindgen_test_layout_C() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBArrayPtr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBArrayPtr as *const _ as usize + }, 56usize, concat!( "Offset of field: ", @@ -182,7 +199,9 @@ fn bindgen_test_layout_C() { concat!("Offset of field: ", stringify!(C), "::", stringify!(mBRef)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<C>())).mBConstRef as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<C>())).mBConstRef as *const _ as usize + }, 72usize, concat!( "Offset of field: ", @@ -271,7 +290,10 @@ fn bindgen_test_layout_RootedContainer() { concat!("Alignment of ", stringify!(RootedContainer)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<RootedContainer>())).root as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<RootedContainer>())).root as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -316,7 +338,10 @@ fn bindgen_test_layout_PODButContainsDtor() { concat!("Alignment of ", stringify!(PODButContainsDtor)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<PODButContainsDtor>())).member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<PODButContainsDtor>())).member as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -355,7 +380,9 @@ fn bindgen_test_layout_POD() { concat!("Alignment of ", stringify!(POD)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<POD>())).opaque_member as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<POD>())).opaque_member as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -564,7 +591,8 @@ fn __bindgen_test_layout_B_open0_ptr_const_mozilla__Foo_close0_instantiation() { ); } #[test] -fn __bindgen_test_layout_B_open0_array1_ptr_const_mozilla__Foo_close0_instantiation() { +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, diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs index 9b66adf6..38a45fd8 100644 --- a/tests/expectations/tests/template_alias.rs +++ b/tests/expectations/tests/template_alias.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type JS_detail_Wrapped<T> = T; #[repr(C)] diff --git a/tests/expectations/tests/template_alias_basic.rs b/tests/expectations/tests/template_alias_basic.rs index 29f3b7c7..f68b9059 100644 --- a/tests/expectations/tests/template_alias_basic.rs +++ b/tests/expectations/tests/template_alias_basic.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type Wrapped<T> = T; diff --git a/tests/expectations/tests/template_alias_namespace.rs b/tests/expectations/tests/template_alias_namespace.rs index dc03a231..56463f2c 100644 --- a/tests/expectations/tests/template_alias_namespace.rs +++ b/tests/expectations/tests/template_alias_namespace.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -20,7 +23,8 @@ pub mod root { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Rooted<T> { pub ptr: root::JS::detail::Wrapped<T>, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, + pub _phantom_0: + ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, } impl<T> Default for Rooted<T> { fn default() -> Self { diff --git a/tests/expectations/tests/template_partial_specification.rs b/tests/expectations/tests/template_partial_specification.rs index 5dcc6c40..d6776794 100644 --- a/tests/expectations/tests/template_partial_specification.rs +++ b/tests/expectations/tests/template_partial_specification.rs @@ -1,4 +1,8 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/tests/expectations/tests/template_typedef_transitive_param.rs index 311dd974..d40e9be3 100644 --- a/tests/expectations/tests/template_typedef_transitive_param.rs +++ b/tests/expectations/tests/template_typedef_transitive_param.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/template_typedefs.rs b/tests/expectations/tests/template_typedefs.rs index df16f9f6..774410b3 100644 --- a/tests/expectations/tests/template_typedefs.rs +++ b/tests/expectations/tests/template_typedefs.rs @@ -1,10 +1,14 @@ /* automatically generated by rust-bindgen */ +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] -#![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,5 +17,8 @@ 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, + unsafe extern "C" fn( + aElement: *mut T, + aData: *mut ::std::os::raw::c_void, + ) -> bool, >; diff --git a/tests/expectations/tests/templateref_opaque.rs b/tests/expectations/tests/templateref_opaque.rs index 481a31bb..b7900240 100644 --- a/tests/expectations/tests/templateref_opaque.rs +++ b/tests/expectations/tests/templateref_opaque.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs index 528a7a2f..79f9e4b5 100644 --- a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs +++ b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs @@ -1,10 +1,11 @@ /* automatically generated by rust-bindgen */ extern "C" { - pub static mut foo: - ::std::option::Option< - unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) - -> ::std::os::raw::c_int, + pub static mut foo: ::std::option::Option< + unsafe extern "C" fn( + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, >; } pub type Char = ::std::os::raw::c_char; @@ -41,92 +42,47 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).ch as *const _ as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(ch) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(ch)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).u as *const _ as usize }, 1usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(u) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(u)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).d as *const _ as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(d) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(d)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).cch as *const _ as usize }, 3usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(cch) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(cch)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).cu as *const _ as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(cu) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(cu)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).cd as *const _ as usize }, 5usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(cd) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(cd)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Cch as *const _ as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(Cch) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Cch)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Cu as *const _ as usize }, 7usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(Cu) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Cu)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Cd as *const _ as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(Cd) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Cd)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Ccch as *const _ as usize }, @@ -141,21 +97,11 @@ fn bindgen_test_layout_Test() { assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Ccu as *const _ as usize }, 10usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(Ccu) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Ccu)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<Test>())).Ccd as *const _ as usize }, 11usize, - concat!( - "Offset of field: ", - stringify!(Test), - "::", - stringify!(Ccd) - ) + concat!("Offset of field: ", stringify!(Test), "::", stringify!(Ccd)) ); } diff --git a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs index 712a8508..0ef64b88 100644 --- a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs +++ b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -22,7 +25,9 @@ fn bindgen_test_layout_dl_phdr_info() { concat!("Alignment of ", stringify!(dl_phdr_info)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<dl_phdr_info>())).x as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<dl_phdr_info>())).x as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/type_alias_empty.rs b/tests/expectations/tests/type_alias_empty.rs index d0f18ded..d9a65f9a 100644 --- a/tests/expectations/tests/type_alias_empty.rs +++ b/tests/expectations/tests/type_alias_empty.rs @@ -1,7 +1,10 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type bool_constant = u8; diff --git a/tests/expectations/tests/type_alias_partial_template_especialization.rs b/tests/expectations/tests/type_alias_partial_template_especialization.rs index 0a2e80fb..53006d28 100644 --- a/tests/expectations/tests/type_alias_partial_template_especialization.rs +++ b/tests/expectations/tests/type_alias_partial_template_especialization.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type MaybeWrapped<A> = A; #[repr(C)] diff --git a/tests/expectations/tests/typedefd-array-as-function-arg.rs b/tests/expectations/tests/typedefd-array-as-function-arg.rs index e4e1cba5..64b69ba7 100644 --- a/tests/expectations/tests/typedefd-array-as-function-arg.rs +++ b/tests/expectations/tests/typedefd-array-as-function-arg.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub type myVector3 = [f32; 3usize]; extern "C" { diff --git a/tests/expectations/tests/typeref.rs b/tests/expectations/tests/typeref.rs index 3a76d514..5f651dc1 100644 --- a/tests/expectations/tests/typeref.rs +++ b/tests/expectations/tests/typeref.rs @@ -26,7 +26,8 @@ fn bindgen_test_layout_mozilla_FragmentOrURL() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<mozilla_FragmentOrURL>())).mIsLocalRef as *const _ as usize + &(*(::std::ptr::null::<mozilla_FragmentOrURL>())).mIsLocalRef + as *const _ as usize }, 0usize, concat!( @@ -136,7 +137,8 @@ impl Default for nsFoo { } } #[test] -fn __bindgen_test_layout_mozilla_StyleShapeSource_open0_int_close0_instantiation() { +fn __bindgen_test_layout_mozilla_StyleShapeSource_open0_int_close0_instantiation( +) { assert_eq!( ::std::mem::size_of::<mozilla_StyleShapeSource>(), 8usize, diff --git a/tests/expectations/tests/typeref_1_0.rs b/tests/expectations/tests/typeref_1_0.rs index 2f5351a9..ae676b5f 100644 --- a/tests/expectations/tests/typeref_1_0.rs +++ b/tests/expectations/tests/typeref_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -66,7 +69,8 @@ fn bindgen_test_layout_mozilla_FragmentOrURL() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<mozilla_FragmentOrURL>())).mIsLocalRef as *const _ as usize + &(*(::std::ptr::null::<mozilla_FragmentOrURL>())).mIsLocalRef + as *const _ as usize }, 0usize, concat!( @@ -184,7 +188,8 @@ impl Clone for nsFoo { } } #[test] -fn __bindgen_test_layout_mozilla_StyleShapeSource_open0_int_close0_instantiation() { +fn __bindgen_test_layout_mozilla_StyleShapeSource_open0_int_close0_instantiation( +) { assert_eq!( ::std::mem::size_of::<mozilla_StyleShapeSource>(), 8usize, diff --git a/tests/expectations/tests/underscore.rs b/tests/expectations/tests/underscore.rs index c4bd288c..3404a3f9 100644 --- a/tests/expectations/tests/underscore.rs +++ b/tests/expectations/tests/underscore.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const __: ::std::os::raw::c_int = 10; #[repr(C)] diff --git a/tests/expectations/tests/union-in-ns.rs b/tests/expectations/tests/union-in-ns.rs index b0d3ac9c..d4bbb740 100644 --- a/tests/expectations/tests/union-in-ns.rs +++ b/tests/expectations/tests/union-in-ns.rs @@ -32,7 +32,12 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<bar>())).baz as *const _ as usize }, 0usize, - concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(bar), + "::", + stringify!(baz) + ) ); } impl Default for bar { diff --git a/tests/expectations/tests/union-in-ns_1_0.rs b/tests/expectations/tests/union-in-ns_1_0.rs index e3a6272e..34d9fbf4 100644 --- a/tests/expectations/tests/union-in-ns_1_0.rs +++ b/tests/expectations/tests/union-in-ns_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -36,7 +39,10 @@ pub mod root { } 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 { + fn fmt( + &self, + fmt: &mut ::std::fmt::Formatter<'_>, + ) -> ::std::fmt::Result { fmt.write_str("__BindgenUnionField") } } @@ -72,7 +78,12 @@ pub mod root { assert_eq!( unsafe { &(*(::std::ptr::null::<bar>())).baz as *const _ as usize }, 0usize, - concat!("Offset of field: ", stringify!(bar), "::", stringify!(baz)) + concat!( + "Offset of field: ", + stringify!(bar), + "::", + stringify!(baz) + ) ); } impl Clone for bar { diff --git a/tests/expectations/tests/union_bitfield.rs b/tests/expectations/tests/union_bitfield.rs index 3bcd9ba4..9e476099 100644 --- a/tests/expectations/tests/union_bitfield.rs +++ b/tests/expectations/tests/union_bitfield.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -115,7 +121,9 @@ impl Default for U4 { impl U4 { #[inline] pub fn derp(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) + } } #[inline] pub fn set_derp(&mut self, val: ::std::os::raw::c_uint) { @@ -125,9 +133,13 @@ impl U4 { } } #[inline] - pub fn new_bitfield_1(derp: ::std::os::raw::c_uint) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + derp: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let derp: u32 = unsafe { ::std::mem::transmute(derp) }; derp as u64 @@ -162,7 +174,9 @@ impl Default for B { impl B { #[inline] pub fn foo(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) + } } #[inline] pub fn set_foo(&mut self, val: ::std::os::raw::c_uint) { @@ -173,7 +187,9 @@ impl B { } #[inline] pub fn bar(&self) -> ::std::os::raw::c_uchar { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u8) + } } #[inline] pub fn set_bar(&mut self, val: ::std::os::raw::c_uchar) { @@ -187,8 +203,10 @@ impl B { foo: ::std::os::raw::c_uint, bar: ::std::os::raw::c_uchar, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 31u8, { let foo: u32 = unsafe { ::std::mem::transmute(foo) }; foo as u64 diff --git a/tests/expectations/tests/union_bitfield_1_0.rs b/tests/expectations/tests/union_bitfield_1_0.rs index c8755381..efc7dfeb 100644 --- a/tests/expectations/tests/union_bitfield_1_0.rs +++ b/tests/expectations/tests/union_bitfield_1_0.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -134,7 +140,8 @@ impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {} #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct U4 { - pub _bitfield_1: __BindgenUnionField<__BindgenBitfieldUnit<[u8; 1usize], u8>>, + pub _bitfield_1: + __BindgenUnionField<__BindgenBitfieldUnit<[u8; 1usize], u8>>, pub bindgen_union_field: u32, } #[test] @@ -158,7 +165,11 @@ impl Clone for U4 { impl U4 { #[inline] pub fn derp(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.as_ref().get(0usize, 1u8) as u32) } + unsafe { + ::std::mem::transmute( + self._bitfield_1.as_ref().get(0usize, 1u8) as u32 + ) + } } #[inline] pub fn set_derp(&mut self, val: ::std::os::raw::c_uint) { @@ -168,9 +179,13 @@ impl U4 { } } #[inline] - pub fn new_bitfield_1(derp: ::std::os::raw::c_uint) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); + pub fn new_bitfield_1( + derp: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 1usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let derp: u32 = unsafe { ::std::mem::transmute(derp) }; derp as u64 @@ -181,7 +196,8 @@ impl U4 { #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct B { - pub _bitfield_1: __BindgenUnionField<__BindgenBitfieldUnit<[u8; 4usize], u32>>, + pub _bitfield_1: + __BindgenUnionField<__BindgenBitfieldUnit<[u8; 4usize], u32>>, pub bindgen_union_field: u32, } #[test] @@ -205,7 +221,11 @@ impl Clone for B { impl B { #[inline] pub fn foo(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.as_ref().get(0usize, 31u8) as u32) } + unsafe { + ::std::mem::transmute( + self._bitfield_1.as_ref().get(0usize, 31u8) as u32 + ) + } } #[inline] pub fn set_foo(&mut self, val: ::std::os::raw::c_uint) { @@ -216,7 +236,11 @@ impl B { } #[inline] pub fn bar(&self) -> ::std::os::raw::c_uchar { - unsafe { ::std::mem::transmute(self._bitfield_1.as_ref().get(31usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute( + self._bitfield_1.as_ref().get(31usize, 1u8) as u8 + ) + } } #[inline] pub fn set_bar(&mut self, val: ::std::os::raw::c_uchar) { @@ -230,8 +254,10 @@ impl B { foo: ::std::os::raw::c_uint, bar: ::std::os::raw::c_uchar, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 31u8, { let foo: u32 = unsafe { ::std::mem::transmute(foo) }; foo as u64 @@ -246,7 +272,8 @@ impl B { #[repr(C)] #[derive(Copy)] pub struct HasBigBitfield { - pub _bitfield_1: __BindgenUnionField<__BindgenBitfieldUnit<[u8; 16usize], u64>>, + pub _bitfield_1: + __BindgenUnionField<__BindgenBitfieldUnit<[u8; 16usize], u64>>, pub bindgen_union_field: [u8; 16usize], } #[test] diff --git a/tests/expectations/tests/union_dtor.rs b/tests/expectations/tests/union_dtor.rs index 1a3ad716..3a24fc4a 100644 --- a/tests/expectations/tests/union_dtor.rs +++ b/tests/expectations/tests/union_dtor.rs @@ -26,7 +26,9 @@ fn bindgen_test_layout_UnionWithDtor() { concat!("Alignment of ", stringify!(UnionWithDtor)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UnionWithDtor>())).mFoo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UnionWithDtor>())).mFoo as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -36,7 +38,9 @@ fn bindgen_test_layout_UnionWithDtor() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UnionWithDtor>())).mBar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UnionWithDtor>())).mBar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_dtor_1_0.rs b/tests/expectations/tests/union_dtor_1_0.rs index 0814b780..0463bc96 100644 --- a/tests/expectations/tests/union_dtor_1_0.rs +++ b/tests/expectations/tests/union_dtor_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -67,7 +70,9 @@ fn bindgen_test_layout_UnionWithDtor() { concat!("Alignment of ", stringify!(UnionWithDtor)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UnionWithDtor>())).mFoo as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UnionWithDtor>())).mFoo as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -77,7 +82,9 @@ fn bindgen_test_layout_UnionWithDtor() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<UnionWithDtor>())).mBar as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<UnionWithDtor>())).mBar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_fields.rs b/tests/expectations/tests/union_fields.rs index e6f4e229..148c19ab 100644 --- a/tests/expectations/tests/union_fields.rs +++ b/tests/expectations/tests/union_fields.rs @@ -28,7 +28,9 @@ fn bindgen_test_layout_nsStyleUnion() { concat!("Alignment of ", stringify!(nsStyleUnion)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mInt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mInt as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -38,7 +40,9 @@ fn bindgen_test_layout_nsStyleUnion() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mFloat as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mFloat as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -48,7 +52,10 @@ fn bindgen_test_layout_nsStyleUnion() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mPointer as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mPointer as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_fields_1_0.rs b/tests/expectations/tests/union_fields_1_0.rs index 6da625d1..0068f97a 100644 --- a/tests/expectations/tests/union_fields_1_0.rs +++ b/tests/expectations/tests/union_fields_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -68,7 +71,9 @@ fn bindgen_test_layout_nsStyleUnion() { concat!("Alignment of ", stringify!(nsStyleUnion)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mInt as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mInt as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -78,7 +83,9 @@ fn bindgen_test_layout_nsStyleUnion() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mFloat as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mFloat as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -88,7 +95,10 @@ fn bindgen_test_layout_nsStyleUnion() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<nsStyleUnion>())).mPointer as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<nsStyleUnion>())).mPointer as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_template_1_0.rs b/tests/expectations/tests/union_template_1_0.rs index a5ab7984..370d2717 100644 --- a/tests/expectations/tests/union_template_1_0.rs +++ b/tests/expectations/tests/union_template_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); diff --git a/tests/expectations/tests/union_with_anon_struct.rs b/tests/expectations/tests/union_with_anon_struct.rs index a1451332..b42063be 100644 --- a/tests/expectations/tests/union_with_anon_struct.rs +++ b/tests/expectations/tests/union_with_anon_struct.rs @@ -32,7 +32,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -42,7 +44,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_struct_1_0.rs b/tests/expectations/tests/union_with_anon_struct_1_0.rs index 2638fa5a..0f53d17e 100644 --- a/tests/expectations/tests/union_with_anon_struct_1_0.rs +++ b/tests/expectations/tests/union_with_anon_struct_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -72,7 +75,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -82,7 +87,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 4usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/tests/expectations/tests/union_with_anon_struct_bitfield.rs index d8aaf221..46a4bb52 100644 --- a/tests/expectations/tests/union_with_anon_struct_bitfield.rs +++ b/tests/expectations/tests/union_with_anon_struct_bitfield.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -117,7 +123,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { impl foo__bindgen_ty_1 { #[inline] pub fn b(&self) -> ::std::os::raw::c_int { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) + } } #[inline] pub fn set_b(&mut self, val: ::std::os::raw::c_int) { @@ -128,7 +136,9 @@ impl foo__bindgen_ty_1 { } #[inline] pub fn c(&self) -> ::std::os::raw::c_int { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) + } } #[inline] pub fn set_c(&mut self, val: ::std::os::raw::c_int) { @@ -142,8 +152,10 @@ impl foo__bindgen_ty_1 { b: ::std::os::raw::c_int, c: ::std::os::raw::c_int, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 7u8, { let b: u32 = unsafe { ::std::mem::transmute(b) }; b as u64 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 2895a391..89047eca 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 @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -165,7 +171,9 @@ impl Clone for foo__bindgen_ty_1 { impl foo__bindgen_ty_1 { #[inline] pub fn b(&self) -> ::std::os::raw::c_int { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) + } } #[inline] pub fn set_b(&mut self, val: ::std::os::raw::c_int) { @@ -176,7 +184,9 @@ impl foo__bindgen_ty_1 { } #[inline] pub fn c(&self) -> ::std::os::raw::c_int { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) + } } #[inline] pub fn set_c(&mut self, val: ::std::os::raw::c_int) { @@ -190,8 +200,10 @@ impl foo__bindgen_ty_1 { b: ::std::os::raw::c_int, c: ::std::os::raw::c_int, ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u32, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 7u8, { let b: u32 = unsafe { ::std::mem::transmute(b) }; b as u64 diff --git a/tests/expectations/tests/union_with_anon_union.rs b/tests/expectations/tests/union_with_anon_union.rs index aa2abc86..bf4775b1 100644 --- a/tests/expectations/tests/union_with_anon_union.rs +++ b/tests/expectations/tests/union_with_anon_union.rs @@ -33,7 +33,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -43,7 +45,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_union_1_0.rs b/tests/expectations/tests/union_with_anon_union_1_0.rs index 8e6c01ee..722ee4d6 100644 --- a/tests/expectations/tests/union_with_anon_union_1_0.rs +++ b/tests/expectations/tests/union_with_anon_union_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -73,7 +76,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -83,7 +88,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/tests/expectations/tests/union_with_anon_unnamed_struct.rs index a1267b39..00887d11 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_struct.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_struct.rs @@ -35,7 +35,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { concat!("Alignment of ", stringify!(pixel__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).r as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).r as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -45,7 +48,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).g as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).g as *const _ + as usize + }, 1usize, concat!( "Offset of field: ", @@ -55,7 +61,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).b as *const _ + as usize + }, 2usize, concat!( "Offset of field: ", @@ -65,7 +74,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).a as *const _ + as usize + }, 3usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs b/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs index 80c83acb..dc9ff2cb 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_struct_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -75,7 +78,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { concat!("Alignment of ", stringify!(pixel__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).r as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).r as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -85,7 +91,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).g as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).g as *const _ + as usize + }, 1usize, concat!( "Offset of field: ", @@ -95,7 +104,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).b as *const _ + as usize + }, 2usize, concat!( "Offset of field: ", @@ -105,7 +117,10 @@ fn bindgen_test_layout_pixel__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<pixel__bindgen_ty_1>())).a as *const _ + as usize + }, 3usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_unnamed_union.rs b/tests/expectations/tests/union_with_anon_unnamed_union.rs index c6272c13..ab729ea2 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_union.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_union.rs @@ -34,7 +34,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -44,7 +46,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).c as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs b/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs index bda49e24..beb151d6 100644 --- a/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs +++ b/tests/expectations/tests/union_with_anon_unnamed_union_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -74,7 +77,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { concat!("Alignment of ", stringify!(foo__bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -84,7 +89,9 @@ fn bindgen_test_layout_foo__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<foo__bindgen_ty_1>())).c as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<foo__bindgen_ty_1>())).c as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_big_member.rs b/tests/expectations/tests/union_with_big_member.rs index c31a69f9..5b459d3c 100644 --- a/tests/expectations/tests/union_with_big_member.rs +++ b/tests/expectations/tests/union_with_big_member.rs @@ -27,7 +27,9 @@ fn bindgen_test_layout_WithBigArray() { concat!("Alignment of ", stringify!(WithBigArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -37,7 +39,9 @@ fn bindgen_test_layout_WithBigArray() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -72,7 +76,9 @@ fn bindgen_test_layout_WithBigArray2() { concat!("Alignment of ", stringify!(WithBigArray2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray2>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray2>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -82,7 +88,9 @@ fn bindgen_test_layout_WithBigArray2() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray2>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray2>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -117,7 +125,9 @@ fn bindgen_test_layout_WithBigMember() { concat!("Alignment of ", stringify!(WithBigMember)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigMember>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigMember>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -127,7 +137,9 @@ fn bindgen_test_layout_WithBigMember() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigMember>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigMember>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_big_member_1_0.rs b/tests/expectations/tests/union_with_big_member_1_0.rs index c636c8e5..31fc7465 100644 --- a/tests/expectations/tests/union_with_big_member_1_0.rs +++ b/tests/expectations/tests/union_with_big_member_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -67,7 +70,9 @@ fn bindgen_test_layout_WithBigArray() { concat!("Alignment of ", stringify!(WithBigArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -77,7 +82,9 @@ fn bindgen_test_layout_WithBigArray() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -117,7 +124,9 @@ fn bindgen_test_layout_WithBigArray2() { concat!("Alignment of ", stringify!(WithBigArray2)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray2>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray2>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -127,7 +136,9 @@ fn bindgen_test_layout_WithBigArray2() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigArray2>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigArray2>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -162,7 +173,9 @@ fn bindgen_test_layout_WithBigMember() { concat!("Alignment of ", stringify!(WithBigMember)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigMember>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigMember>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -172,7 +185,9 @@ fn bindgen_test_layout_WithBigMember() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WithBigMember>())).b as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WithBigMember>())).b as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/union_with_nesting.rs b/tests/expectations/tests/union_with_nesting.rs index 0a4fd91c..eeefa6af 100644 --- a/tests/expectations/tests/union_with_nesting.rs +++ b/tests/expectations/tests/union_with_nesting.rs @@ -41,7 +41,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b1 + as *const _ as usize }, 0usize, concat!( @@ -53,7 +54,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b2 + as *const _ as usize }, 0usize, concat!( @@ -90,7 +92,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c1 + as *const _ as usize }, 0usize, concat!( @@ -102,7 +105,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c2 + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/union_with_nesting_1_0.rs b/tests/expectations/tests/union_with_nesting_1_0.rs index b9fc908f..1ae7d31f 100644 --- a/tests/expectations/tests/union_with_nesting_1_0.rs +++ b/tests/expectations/tests/union_with_nesting_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); @@ -81,7 +84,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b1 + as *const _ as usize }, 0usize, concat!( @@ -93,7 +97,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_1() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_1>())).b2 + as *const _ as usize }, 0usize, concat!( @@ -130,7 +135,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c1 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c1 + as *const _ as usize }, 0usize, concat!( @@ -142,7 +148,8 @@ fn bindgen_test_layout_foo__bindgen_ty_1__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c2 as *const _ as usize + &(*(::std::ptr::null::<foo__bindgen_ty_1__bindgen_ty_2>())).c2 + as *const _ as usize }, 0usize, concat!( diff --git a/tests/expectations/tests/unknown_attr.rs b/tests/expectations/tests/unknown_attr.rs index a11f105a..d7c8134c 100644 --- a/tests/expectations/tests/unknown_attr.rs +++ b/tests/expectations/tests/unknown_attr.rs @@ -30,7 +30,8 @@ fn bindgen_test_layout_max_align_t() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce1 as *const _ as usize + &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce1 + as *const _ as usize }, 0usize, concat!( @@ -42,7 +43,8 @@ fn bindgen_test_layout_max_align_t() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce2 as *const _ as usize + &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce2 + as *const _ as usize }, 16usize, concat!( diff --git a/tests/expectations/tests/use-core.rs b/tests/expectations/tests/use-core.rs index a2dfc97f..04a0f0a7 100644 --- a/tests/expectations/tests/use-core.rs +++ b/tests/expectations/tests/use-core.rs @@ -69,7 +69,9 @@ fn bindgen_test_layout__bindgen_ty_1() { concat!("Alignment of ", stringify!(_bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<_bindgen_ty_1>())).bar as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<_bindgen_ty_1>())).bar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -79,7 +81,9 @@ fn bindgen_test_layout__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<_bindgen_ty_1>())).baz as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<_bindgen_ty_1>())).baz as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -97,4 +101,5 @@ impl Default for _bindgen_ty_1 { extern "C" { pub static mut bazz: _bindgen_ty_1; } -pub type fooFunction = ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>; +pub type fooFunction = + ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>; diff --git a/tests/expectations/tests/use-core_1_0.rs b/tests/expectations/tests/use-core_1_0.rs index ce17d3bc..55518006 100644 --- a/tests/expectations/tests/use-core_1_0.rs +++ b/tests/expectations/tests/use-core_1_0.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern crate core; @@ -113,7 +117,9 @@ fn bindgen_test_layout__bindgen_ty_1() { concat!("Alignment of ", stringify!(_bindgen_ty_1)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<_bindgen_ty_1>())).bar as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<_bindgen_ty_1>())).bar as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -123,7 +129,9 @@ fn bindgen_test_layout__bindgen_ty_1() { ) ); assert_eq!( - unsafe { &(*(::core::ptr::null::<_bindgen_ty_1>())).baz as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::<_bindgen_ty_1>())).baz as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -141,4 +149,5 @@ impl Clone for _bindgen_ty_1 { extern "C" { pub static mut bazz: _bindgen_ty_1; } -pub type fooFunction = ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>; +pub type fooFunction = + ::core::option::Option<unsafe extern "C" fn(bar: ::std::os::raw::c_int)>; diff --git a/tests/expectations/tests/using.rs b/tests/expectations/tests/using.rs index 9bc5e303..bc30c5d4 100644 --- a/tests/expectations/tests/using.rs +++ b/tests/expectations/tests/using.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/var-tracing.rs b/tests/expectations/tests/var-tracing.rs index 03b23ead..214f10f8 100644 --- a/tests/expectations/tests/var-tracing.rs +++ b/tests/expectations/tests/var-tracing.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/variadic-method.rs b/tests/expectations/tests/variadic-method.rs index 94dd73be..ff62aa22 100644 --- a/tests/expectations/tests/variadic-method.rs +++ b/tests/expectations/tests/variadic-method.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] extern "C" { #[link_name = "\u{1}_Z3fooPKcz"] diff --git a/tests/expectations/tests/variadic_template_function.rs b/tests/expectations/tests/variadic_template_function.rs index e14da64f..2b3ae2b4 100644 --- a/tests/expectations/tests/variadic_template_function.rs +++ b/tests/expectations/tests/variadic_template_function.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/virtual_dtor.rs b/tests/expectations/tests/virtual_dtor.rs index 91830908..486de8c6 100644 --- a/tests/expectations/tests/virtual_dtor.rs +++ b/tests/expectations/tests/virtual_dtor.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct nsSlots__bindgen_vtable(::std::os::raw::c_void); diff --git a/tests/expectations/tests/virtual_inheritance.rs b/tests/expectations/tests/virtual_inheritance.rs index ed5d1151..4da41704 100644 --- a/tests/expectations/tests/virtual_inheritance.rs +++ b/tests/expectations/tests/virtual_inheritance.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/virtual_overloaded.rs b/tests/expectations/tests/virtual_overloaded.rs index 376bae8a..f55b5153 100644 --- a/tests/expectations/tests/virtual_overloaded.rs +++ b/tests/expectations/tests/virtual_overloaded.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct C__bindgen_vtable(::std::os::raw::c_void); @@ -31,9 +34,15 @@ impl Default for C { } extern "C" { #[link_name = "\u{1}_ZN1C8do_thingEc"] - pub fn C_do_thing(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_char); + pub fn C_do_thing( + this: *mut ::std::os::raw::c_void, + arg1: ::std::os::raw::c_char, + ); } extern "C" { #[link_name = "\u{1}_ZN1C8do_thingEi"] - pub fn C_do_thing1(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_int); + pub fn C_do_thing1( + this: *mut ::std::os::raw::c_void, + arg1: ::std::os::raw::c_int, + ); } diff --git a/tests/expectations/tests/vtable_recursive_sig.rs b/tests/expectations/tests/vtable_recursive_sig.rs index f0720f27..90d8b0e3 100644 --- a/tests/expectations/tests/vtable_recursive_sig.rs +++ b/tests/expectations/tests/vtable_recursive_sig.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] pub struct Base__bindgen_vtable(::std::os::raw::c_void); diff --git a/tests/expectations/tests/weird_bitfields.rs b/tests/expectations/tests/weird_bitfields.rs index a91aae68..b786198c 100644 --- a/tests/expectations/tests/weird_bitfields.rs +++ b/tests/expectations/tests/weird_bitfields.rs @@ -57,7 +57,10 @@ where pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { @@ -75,7 +78,10 @@ where pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + debug_assert!( + (bit_offset + (bit_width as usize)) / 8 <= + self.storage.as_ref().len() + ); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; @@ -127,7 +133,10 @@ fn bindgen_test_layout_Weird() { concat!("Alignment of ", stringify!(Weird)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mStrokeDasharrayLength as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mStrokeDasharrayLength as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", @@ -137,7 +146,9 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mClipRule as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mClipRule as *const _ as usize + }, 8usize, concat!( "Offset of field: ", @@ -147,7 +158,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mColorInterpolation as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mColorInterpolation as *const _ + as usize + }, 9usize, concat!( "Offset of field: ", @@ -158,7 +172,8 @@ fn bindgen_test_layout_Weird() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<Weird>())).mColorInterpolationFilters as *const _ as usize + &(*(::std::ptr::null::<Weird>())).mColorInterpolationFilters + as *const _ as usize }, 10usize, concat!( @@ -169,7 +184,9 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mFillRule as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mFillRule as *const _ as usize + }, 11usize, concat!( "Offset of field: ", @@ -179,7 +196,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mImageRendering as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mImageRendering as *const _ + as usize + }, 12usize, concat!( "Offset of field: ", @@ -189,7 +209,9 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mPaintOrder as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mPaintOrder as *const _ as usize + }, 13usize, concat!( "Offset of field: ", @@ -199,7 +221,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mShapeRendering as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mShapeRendering as *const _ + as usize + }, 14usize, concat!( "Offset of field: ", @@ -209,7 +234,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mStrokeLinecap as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mStrokeLinecap as *const _ + as usize + }, 15usize, concat!( "Offset of field: ", @@ -219,7 +247,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mStrokeLinejoin as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mStrokeLinejoin as *const _ + as usize + }, 16usize, concat!( "Offset of field: ", @@ -229,7 +260,9 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mTextAnchor as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mTextAnchor as *const _ as usize + }, 17usize, concat!( "Offset of field: ", @@ -239,7 +272,10 @@ fn bindgen_test_layout_Weird() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Weird>())).mTextRendering as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Weird>())).mTextRendering as *const _ + as usize + }, 18usize, concat!( "Offset of field: ", @@ -257,7 +293,9 @@ impl Default for Weird { impl Weird { #[inline] pub fn bitTest(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u32) + } } #[inline] pub fn set_bitTest(&mut self, val: ::std::os::raw::c_uint) { @@ -268,7 +306,9 @@ impl Weird { } #[inline] pub fn bitTest2(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 15u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_1.get(16usize, 15u8) as u32) + } } #[inline] pub fn set_bitTest2(&mut self, val: ::std::os::raw::c_uint) { @@ -282,8 +322,10 @@ impl Weird { bitTest: ::std::os::raw::c_uint, bitTest2: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 4usize], + u16, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 16u8, { let bitTest: u32 = unsafe { ::std::mem::transmute(bitTest) }; bitTest as u64 @@ -296,7 +338,9 @@ impl Weird { } #[inline] pub fn mFillOpacitySource(&self) -> nsStyleSVGOpacitySource { - unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 3u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(0usize, 3u8) as u32) + } } #[inline] pub fn set_mFillOpacitySource(&mut self, val: nsStyleSVGOpacitySource) { @@ -307,7 +351,9 @@ impl Weird { } #[inline] pub fn mStrokeOpacitySource(&self) -> nsStyleSVGOpacitySource { - unsafe { ::std::mem::transmute(self._bitfield_2.get(3usize, 3u8) as u32) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(3usize, 3u8) as u32) + } } #[inline] pub fn set_mStrokeOpacitySource(&mut self, val: nsStyleSVGOpacitySource) { @@ -318,7 +364,9 @@ impl Weird { } #[inline] pub fn mStrokeDasharrayFromObject(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_2.get(6usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(6usize, 1u8) as u8) + } } #[inline] pub fn set_mStrokeDasharrayFromObject(&mut self, val: bool) { @@ -329,7 +377,9 @@ impl Weird { } #[inline] pub fn mStrokeDashoffsetFromObject(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_2.get(7usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(7usize, 1u8) as u8) + } } #[inline] pub fn set_mStrokeDashoffsetFromObject(&mut self, val: bool) { @@ -340,7 +390,9 @@ impl Weird { } #[inline] pub fn mStrokeWidthFromObject(&self) -> bool { - unsafe { ::std::mem::transmute(self._bitfield_2.get(8usize, 1u8) as u8) } + unsafe { + ::std::mem::transmute(self._bitfield_2.get(8usize, 1u8) as u8) + } } #[inline] pub fn set_mStrokeWidthFromObject(&mut self, val: bool) { @@ -357,14 +409,18 @@ impl Weird { mStrokeDashoffsetFromObject: bool, mStrokeWidthFromObject: bool, ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = - Default::default(); + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit< + [u8; 2usize], + u8, + > = Default::default(); __bindgen_bitfield_unit.set(0usize, 3u8, { - let mFillOpacitySource: u32 = unsafe { ::std::mem::transmute(mFillOpacitySource) }; + let mFillOpacitySource: u32 = + unsafe { ::std::mem::transmute(mFillOpacitySource) }; mFillOpacitySource as u64 }); __bindgen_bitfield_unit.set(3usize, 3u8, { - let mStrokeOpacitySource: u32 = unsafe { ::std::mem::transmute(mStrokeOpacitySource) }; + let mStrokeOpacitySource: u32 = + unsafe { ::std::mem::transmute(mStrokeOpacitySource) }; mStrokeOpacitySource as u64 }); __bindgen_bitfield_unit.set(6usize, 1u8, { diff --git a/tests/expectations/tests/what_is_going_on.rs b/tests/expectations/tests/what_is_going_on.rs index d0e4c689..8c954c4c 100644 --- a/tests/expectations/tests/what_is_going_on.rs +++ b/tests/expectations/tests/what_is_going_on.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] diff --git a/tests/expectations/tests/whitelist-namespaces-basic.rs b/tests/expectations/tests/whitelist-namespaces-basic.rs index 74c782f7..39ad1ed6 100644 --- a/tests/expectations/tests/whitelist-namespaces-basic.rs +++ b/tests/expectations/tests/whitelist-namespaces-basic.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { diff --git a/tests/expectations/tests/whitelist-namespaces.rs b/tests/expectations/tests/whitelist-namespaces.rs index cd179ca7..6f36034b 100644 --- a/tests/expectations/tests/whitelist-namespaces.rs +++ b/tests/expectations/tests/whitelist-namespaces.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -51,7 +54,9 @@ pub mod root { concat!("Alignment of ", stringify!(Test)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<Test>())).helper as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<Test>())).helper as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/whitelist_basic.rs b/tests/expectations/tests/whitelist_basic.rs index 7ff1160d..0fa97eab 100644 --- a/tests/expectations/tests/whitelist_basic.rs +++ b/tests/expectations/tests/whitelist_basic.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/tests/expectations/tests/whitelist_fix.rs b/tests/expectations/tests/whitelist_fix.rs index ed30347c..a14b0e56 100644 --- a/tests/expectations/tests/whitelist_fix.rs +++ b/tests/expectations/tests/whitelist_fix.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub enum Test {} diff --git a/tests/expectations/tests/whitelist_vars.rs b/tests/expectations/tests/whitelist_vars.rs index b8f10998..29cb7389 100644 --- a/tests/expectations/tests/whitelist_vars.rs +++ b/tests/expectations/tests/whitelist_vars.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] pub const NONE: u32 = 0; pub const FOO: u32 = 5; diff --git a/tests/expectations/tests/whitelisted-item-references-no-hash.rs b/tests/expectations/tests/whitelisted-item-references-no-hash.rs index bf6eda64..3a5655bf 100644 --- a/tests/expectations/tests/whitelisted-item-references-no-hash.rs +++ b/tests/expectations/tests/whitelisted-item-references-no-hash.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -40,7 +43,9 @@ fn bindgen_test_layout_WhitelistMe() { concat!("Alignment of ", stringify!(WhitelistMe)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs b/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs index cfcbf5a4..4e1ee2de 100644 --- a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs +++ b/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -40,7 +43,9 @@ fn bindgen_test_layout_WhitelistMe() { concat!("Alignment of ", stringify!(WhitelistMe)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/whitelisted_item_references_no_copy.rs b/tests/expectations/tests/whitelisted_item_references_no_copy.rs index 2e635dc2..2a4bfa60 100644 --- a/tests/expectations/tests/whitelisted_item_references_no_copy.rs +++ b/tests/expectations/tests/whitelisted_item_references_no_copy.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default)] @@ -40,7 +43,9 @@ fn bindgen_test_layout_WhitelistMe() { concat!("Alignment of ", stringify!(WhitelistMe)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize + }, 0usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/win32-thiscall_1_0.rs b/tests/expectations/tests/win32-thiscall_1_0.rs index f84a7005..e9c5d976 100644 --- a/tests/expectations/tests/win32-thiscall_1_0.rs +++ b/tests/expectations/tests/win32-thiscall_1_0.rs @@ -1,8 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[repr(C)] #[derive(Debug, Default, Copy)] diff --git a/tests/expectations/tests/win32-thiscall_nightly.rs b/tests/expectations/tests/win32-thiscall_nightly.rs index 3b0140dc..a135b63f 100644 --- a/tests/expectations/tests/win32-thiscall_nightly.rs +++ b/tests/expectations/tests/win32-thiscall_nightly.rs @@ -1,7 +1,11 @@ /* automatically generated by rust-bindgen */ - -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #![cfg(feature = "nightly")] #![feature(abi_thiscall)] @@ -29,7 +33,10 @@ extern "thiscall" { } extern "thiscall" { #[link_name = "\u{1}?test2@Foo@@QAEHH@Z"] - pub fn Foo_test2(this: *mut Foo, var: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn Foo_test2( + this: *mut Foo, + var: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } impl Foo { #[inline] @@ -37,7 +44,10 @@ impl Foo { Foo_test(self) } #[inline] - pub unsafe fn test2(&mut self, var: ::std::os::raw::c_int) -> ::std::os::raw::c_int { + pub unsafe fn test2( + &mut self, + var: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int { Foo_test2(self, var) } } diff --git a/tests/expectations/tests/with_array_pointers_arguments.rs b/tests/expectations/tests/with_array_pointers_arguments.rs index 3808e18b..9c7b225b 100644 --- a/tests/expectations/tests/with_array_pointers_arguments.rs +++ b/tests/expectations/tests/with_array_pointers_arguments.rs @@ -8,10 +8,16 @@ )] extern "C" { - pub fn test_fn(a: f32, arr: *mut [::std::os::raw::c_int; 20usize]) -> ::std::os::raw::c_int; + pub fn test_fn( + a: f32, + arr: *mut [::std::os::raw::c_int; 20usize], + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn test_fn2(arr: *const [f32; 20usize], b: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn test_fn2( + arr: *const [f32; 20usize], + b: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } pub type defArr = [::std::os::raw::c_char; 20usize]; pub type foo = ::std::option::Option<unsafe extern "C" fn(a: *mut defArr)>; diff --git a/tests/expectations/tests/without_array_pointers_arguments.rs b/tests/expectations/tests/without_array_pointers_arguments.rs index b6168937..4221fc0c 100644 --- a/tests/expectations/tests/without_array_pointers_arguments.rs +++ b/tests/expectations/tests/without_array_pointers_arguments.rs @@ -8,13 +8,20 @@ )] extern "C" { - pub fn test_fn(a: f32, arr: *mut ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn test_fn( + a: f32, + arr: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn test_fn2(arr: *const f32, b: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn test_fn2( + arr: *const f32, + b: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } pub type defArr = [::std::os::raw::c_char; 20usize]; -pub type foo = ::std::option::Option<unsafe extern "C" fn(a: *mut ::std::os::raw::c_char)>; +pub type foo = + ::std::option::Option<unsafe extern "C" fn(a: *mut ::std::os::raw::c_char)>; extern "C" { pub fn bar(a: *mut ::std::os::raw::c_char); } diff --git a/tests/expectations/tests/zero-size-array-align.rs b/tests/expectations/tests/zero-size-array-align.rs index 1debdaea..f17647d1 100644 --- a/tests/expectations/tests/zero-size-array-align.rs +++ b/tests/expectations/tests/zero-size-array-align.rs @@ -63,7 +63,9 @@ fn bindgen_test_layout_dm_deps() { concat!("Alignment of ", stringify!(dm_deps)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<dm_deps>())).count as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<dm_deps>())).count as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -73,7 +75,9 @@ fn bindgen_test_layout_dm_deps() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<dm_deps>())).filler as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<dm_deps>())).filler as *const _ as usize + }, 4usize, concat!( "Offset of field: ", @@ -83,7 +87,9 @@ fn bindgen_test_layout_dm_deps() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<dm_deps>())).device as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<dm_deps>())).device as *const _ as usize + }, 8usize, concat!( "Offset of field: ", diff --git a/tests/expectations/tests/zero-sized-array.rs b/tests/expectations/tests/zero-sized-array.rs index c0b989c8..7dee6fb2 100644 --- a/tests/expectations/tests/zero-sized-array.rs +++ b/tests/expectations/tests/zero-sized-array.rs @@ -62,7 +62,9 @@ fn bindgen_test_layout_ZeroSizedArray() { concat!("Alignment of ", stringify!(ZeroSizedArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ZeroSizedArray>())).arr as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ZeroSizedArray>())).arr as *const _ as usize + }, 0usize, concat!( "Offset of field: ", @@ -91,7 +93,10 @@ fn bindgen_test_layout_ContainsZeroSizedArray() { concat!("Alignment of ", stringify!(ContainsZeroSizedArray)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<ContainsZeroSizedArray>())).zsa as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<ContainsZeroSizedArray>())).zsa as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", |