Skip to content

Commit 02c46bb

Browse files
committed
Run rustfmt on all of the test expectations
1 parent 8582a90 commit 02c46bb

File tree

235 files changed

+10263
-4856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+10263
-4856
lines changed

tests/expectations/tests/16-byte-alignment.rs

Lines changed: 241 additions & 122 deletions
Large diffs are not rendered by default.

tests/expectations/tests/16-byte-alignment_1_0.rs

Lines changed: 256 additions & 133 deletions
Large diffs are not rendered by default.

tests/expectations/tests/accessors.rs

Lines changed: 229 additions & 115 deletions
Large diffs are not rendered by default.

tests/expectations/tests/anon_enum.rs

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,50 @@ pub struct Test {
1313
pub const Test_T_NONE: Test__bindgen_ty_1 = Test__bindgen_ty_1::T_NONE;
1414
#[repr(u32)]
1515
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
16-
pub enum Test__bindgen_ty_1 { T_NONE = 0, }
16+
pub enum Test__bindgen_ty_1 {
17+
T_NONE = 0,
18+
}
1719
#[test]
1820
fn bindgen_test_layout_Test() {
19-
assert_eq!(::std::mem::size_of::<Test>() , 8usize , concat ! (
20-
"Size of: " , stringify ! ( Test ) ));
21-
assert_eq! (::std::mem::align_of::<Test>() , 4usize , concat ! (
22-
"Alignment of " , stringify ! ( Test ) ));
23-
assert_eq! (unsafe {
24-
& ( * ( 0 as * const Test ) ) . foo as * const _ as usize } ,
25-
0usize , concat ! (
26-
"Alignment of field: " , stringify ! ( Test ) , "::" ,
27-
stringify ! ( foo ) ));
28-
assert_eq! (unsafe {
29-
& ( * ( 0 as * const Test ) ) . bar as * const _ as usize } ,
30-
4usize , concat ! (
31-
"Alignment of field: " , stringify ! ( Test ) , "::" ,
32-
stringify ! ( bar ) ));
21+
assert_eq!(
22+
::std::mem::size_of::<Test>(),
23+
8usize,
24+
concat!("Size of: ", stringify!(Test))
25+
);
26+
assert_eq!(
27+
::std::mem::align_of::<Test>(),
28+
4usize,
29+
concat!("Alignment of ", stringify!(Test))
30+
);
31+
assert_eq!(
32+
unsafe { &(*(0 as *const Test)).foo as *const _ as usize },
33+
0usize,
34+
concat!(
35+
"Alignment of field: ",
36+
stringify!(Test),
37+
"::",
38+
stringify!(foo)
39+
)
40+
);
41+
assert_eq!(
42+
unsafe { &(*(0 as *const Test)).bar as *const _ as usize },
43+
4usize,
44+
concat!(
45+
"Alignment of field: ",
46+
stringify!(Test),
47+
"::",
48+
stringify!(bar)
49+
)
50+
);
3351
}
3452
impl Clone for Test {
35-
fn clone(&self) -> Self { *self }
53+
fn clone(&self) -> Self {
54+
*self
55+
}
3656
}
3757
#[repr(u32)]
3858
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
39-
pub enum Baz { Foo = 0, Bar = 1, }
59+
pub enum Baz {
60+
Foo = 0,
61+
Bar = 1,
62+
}

tests/expectations/tests/anon_enum_trait.rs

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ pub type DataType_value_type<_Tp> = _Tp;
1313
pub type DataType_work_type<_Tp> = DataType_value_type<_Tp>;
1414
pub type DataType_channel_type<_Tp> = DataType_value_type<_Tp>;
1515
pub type DataType_vec_type<_Tp> = DataType_value_type<_Tp>;
16-
pub const DataType_generic_type: DataType__bindgen_ty_1 =
17-
DataType__bindgen_ty_1::generic_type;
18-
pub const DataType_depth: DataType__bindgen_ty_1 =
19-
DataType__bindgen_ty_1::generic_type;
20-
pub const DataType_channels: DataType__bindgen_ty_1 =
21-
DataType__bindgen_ty_1::generic_type;
22-
pub const DataType_fmt: DataType__bindgen_ty_1 =
23-
DataType__bindgen_ty_1::generic_type;
24-
pub const DataType_type_: DataType__bindgen_ty_1 =
25-
DataType__bindgen_ty_1::generic_type;
16+
pub const DataType_generic_type: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type;
17+
pub const DataType_depth: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type;
18+
pub const DataType_channels: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type;
19+
pub const DataType_fmt: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type;
20+
pub const DataType_type_: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type;
2621
#[repr(i32)]
2722
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
28-
pub enum DataType__bindgen_ty_1 { generic_type = 0, }
23+
pub enum DataType__bindgen_ty_1 {
24+
generic_type = 0,
25+
}
2926
#[repr(C)]
3027
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)]
3128
pub struct Foo {
@@ -35,14 +32,24 @@ pub const Foo_Bar: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar;
3532
pub const Foo_Baz: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar;
3633
#[repr(u32)]
3734
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
38-
pub enum Foo__bindgen_ty_1 { Bar = 0, }
35+
pub enum Foo__bindgen_ty_1 {
36+
Bar = 0,
37+
}
3938
#[test]
4039
fn bindgen_test_layout_Foo() {
41-
assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
42-
"Size of: " , stringify ! ( Foo ) ));
43-
assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
44-
"Alignment of " , stringify ! ( Foo ) ));
40+
assert_eq!(
41+
::std::mem::size_of::<Foo>(),
42+
1usize,
43+
concat!("Size of: ", stringify!(Foo))
44+
);
45+
assert_eq!(
46+
::std::mem::align_of::<Foo>(),
47+
1usize,
48+
concat!("Alignment of ", stringify!(Foo))
49+
);
4550
}
4651
impl Clone for Foo {
47-
fn clone(&self) -> Self { *self }
52+
fn clone(&self) -> Self {
53+
*self
54+
}
4855
}

tests/expectations/tests/anon_enum_whitelist.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ pub const NODE_FLAG_FOO: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_FOO;
88
pub const NODE_FLAG_BAR: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_BAR;
99
#[repr(u32)]
1010
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
11-
pub enum _bindgen_ty_1 { NODE_FLAG_FOO = 0, NODE_FLAG_BAR = 1, }
11+
pub enum _bindgen_ty_1 {
12+
NODE_FLAG_FOO = 0,
13+
NODE_FLAG_BAR = 1,
14+
}

tests/expectations/tests/anon_struct_in_union.rs

Lines changed: 70 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,53 +22,90 @@ pub struct s__bindgen_ty_1_inner {
2222
}
2323
#[test]
2424
fn bindgen_test_layout_s__bindgen_ty_1_inner() {
25-
assert_eq!(::std::mem::size_of::<s__bindgen_ty_1_inner>() , 4usize ,
26-
concat ! ( "Size of: " , stringify ! ( s__bindgen_ty_1_inner )
27-
));
28-
assert_eq! (::std::mem::align_of::<s__bindgen_ty_1_inner>() , 4usize ,
29-
concat ! (
30-
"Alignment of " , stringify ! ( s__bindgen_ty_1_inner ) ));
31-
assert_eq! (unsafe {
32-
& ( * ( 0 as * const s__bindgen_ty_1_inner ) ) . b as * const
33-
_ as usize } , 0usize , concat ! (
34-
"Alignment of field: " , stringify ! ( s__bindgen_ty_1_inner )
35-
, "::" , stringify ! ( b ) ));
25+
assert_eq!(
26+
::std::mem::size_of::<s__bindgen_ty_1_inner>(),
27+
4usize,
28+
concat!("Size of: ", stringify!(s__bindgen_ty_1_inner))
29+
);
30+
assert_eq!(
31+
::std::mem::align_of::<s__bindgen_ty_1_inner>(),
32+
4usize,
33+
concat!("Alignment of ", stringify!(s__bindgen_ty_1_inner))
34+
);
35+
assert_eq!(
36+
unsafe { &(*(0 as *const s__bindgen_ty_1_inner)).b as *const _ as usize },
37+
0usize,
38+
concat!(
39+
"Alignment of field: ",
40+
stringify!(s__bindgen_ty_1_inner),
41+
"::",
42+
stringify!(b)
43+
)
44+
);
3645
}
3746
impl Clone for s__bindgen_ty_1_inner {
38-
fn clone(&self) -> Self { *self }
47+
fn clone(&self) -> Self {
48+
*self
49+
}
3950
}
4051
#[test]
4152
fn bindgen_test_layout_s__bindgen_ty_1() {
42-
assert_eq!(::std::mem::size_of::<s__bindgen_ty_1>() , 4usize , concat ! (
43-
"Size of: " , stringify ! ( s__bindgen_ty_1 ) ));
44-
assert_eq! (::std::mem::align_of::<s__bindgen_ty_1>() , 4usize , concat !
45-
( "Alignment of " , stringify ! ( s__bindgen_ty_1 ) ));
46-
assert_eq! (unsafe {
47-
& ( * ( 0 as * const s__bindgen_ty_1 ) ) . field as * const _
48-
as usize } , 0usize , concat ! (
49-
"Alignment of field: " , stringify ! ( s__bindgen_ty_1 ) ,
50-
"::" , stringify ! ( field ) ));
53+
assert_eq!(
54+
::std::mem::size_of::<s__bindgen_ty_1>(),
55+
4usize,
56+
concat!("Size of: ", stringify!(s__bindgen_ty_1))
57+
);
58+
assert_eq!(
59+
::std::mem::align_of::<s__bindgen_ty_1>(),
60+
4usize,
61+
concat!("Alignment of ", stringify!(s__bindgen_ty_1))
62+
);
63+
assert_eq!(
64+
unsafe { &(*(0 as *const s__bindgen_ty_1)).field as *const _ as usize },
65+
0usize,
66+
concat!(
67+
"Alignment of field: ",
68+
stringify!(s__bindgen_ty_1),
69+
"::",
70+
stringify!(field)
71+
)
72+
);
5173
}
5274
impl Clone for s__bindgen_ty_1 {
53-
fn clone(&self) -> Self { *self }
75+
fn clone(&self) -> Self {
76+
*self
77+
}
5478
}
5579
impl Default for s__bindgen_ty_1 {
56-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
80+
fn default() -> Self {
81+
unsafe { ::std::mem::zeroed() }
82+
}
5783
}
5884
#[test]
5985
fn bindgen_test_layout_s() {
60-
assert_eq!(::std::mem::size_of::<s>() , 4usize , concat ! (
61-
"Size of: " , stringify ! ( s ) ));
62-
assert_eq! (::std::mem::align_of::<s>() , 4usize , concat ! (
63-
"Alignment of " , stringify ! ( s ) ));
64-
assert_eq! (unsafe { & ( * ( 0 as * const s ) ) . u as * const _ as usize
65-
} , 0usize , concat ! (
66-
"Alignment of field: " , stringify ! ( s ) , "::" , stringify
67-
! ( u ) ));
86+
assert_eq!(
87+
::std::mem::size_of::<s>(),
88+
4usize,
89+
concat!("Size of: ", stringify!(s))
90+
);
91+
assert_eq!(
92+
::std::mem::align_of::<s>(),
93+
4usize,
94+
concat!("Alignment of ", stringify!(s))
95+
);
96+
assert_eq!(
97+
unsafe { &(*(0 as *const s)).u as *const _ as usize },
98+
0usize,
99+
concat!("Alignment of field: ", stringify!(s), "::", stringify!(u))
100+
);
68101
}
69102
impl Clone for s {
70-
fn clone(&self) -> Self { *self }
103+
fn clone(&self) -> Self {
104+
*self
105+
}
71106
}
72107
impl Default for s {
73-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
108+
fn default() -> Self {
109+
unsafe { ::std::mem::zeroed() }
110+
}
74111
}

0 commit comments

Comments
 (0)