12
12
#![ crate_type = "lib" ]
13
13
#![ no_core]
14
14
15
- #[ lang="sized" ]
16
- trait Sized { }
17
- #[ lang="freeze" ]
18
- trait Freeze { }
19
- #[ lang="copy" ]
20
- trait Copy { }
21
-
22
-
15
+ #[ lang = "sized" ]
16
+ trait Sized { }
17
+ #[ lang = "freeze" ]
18
+ trait Freeze { }
19
+ #[ lang = "copy" ]
20
+ trait Copy { }
23
21
24
22
// Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
25
23
#[ repr( C ) ]
@@ -31,7 +29,7 @@ pub struct Align8 {
31
29
// repr(transparent), so same as above.
32
30
#[ repr( transparent) ]
33
31
pub struct Transparent8 {
34
- a : Align8
32
+ a : Align8 ,
35
33
}
36
34
37
35
// Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
@@ -47,8 +45,6 @@ extern "C" {
47
45
fn test_8 ( a : Align8 , b : Transparent8 , c : Wrapped8 ) ;
48
46
}
49
47
50
-
51
-
52
48
// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
53
49
// EXCEPT on Linux, where there's a special case to use its unadjusted alignment,
54
50
// making it the same as `Align8`, so it's be passed as `[i64 x 2]`.
@@ -62,7 +58,7 @@ pub struct Align16 {
62
58
// repr(transparent), so same as above.
63
59
#[ repr( transparent) ]
64
60
pub struct Transparent16 {
65
- a : Align16
61
+ a : Align16 ,
66
62
}
67
63
68
64
// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
@@ -79,8 +75,6 @@ extern "C" {
79
75
fn test_16 ( a : Align16 , b : Transparent16 , c : Wrapped16 ) ;
80
76
}
81
77
82
-
83
-
84
78
// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
85
79
#[ repr( C ) ]
86
80
pub struct I128 {
@@ -90,13 +84,13 @@ pub struct I128 {
90
84
// repr(transparent), so same as above.
91
85
#[ repr( transparent) ]
92
86
pub struct TransparentI128 {
93
- a : I128
87
+ a : I128 ,
94
88
}
95
89
96
90
// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
97
91
#[ repr( C ) ]
98
92
pub struct WrappedI128 {
99
- pub a : I128
93
+ pub a : I128 ,
100
94
}
101
95
102
96
extern "C" {
@@ -106,8 +100,6 @@ extern "C" {
106
100
fn test_i128 ( a : I128 , b : TransparentI128 , c : WrappedI128 ) ;
107
101
}
108
102
109
-
110
-
111
103
// Passed as `[2 x i64]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
112
104
// Note that the Linux special case does not apply, because packing is not considered "adjustment".
113
105
#[ repr( C ) ]
@@ -119,13 +111,13 @@ pub struct Packed {
119
111
// repr(transparent), so same as above.
120
112
#[ repr( transparent) ]
121
113
pub struct TransparentPacked {
122
- a : Packed
114
+ a : Packed ,
123
115
}
124
116
125
117
// Passed as `[2 x i64]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
126
118
#[ repr( C ) ]
127
119
pub struct WrappedPacked {
128
- pub a : Packed
120
+ pub a : Packed ,
129
121
}
130
122
131
123
extern "C" {
@@ -135,13 +127,19 @@ extern "C" {
135
127
fn test_packed ( a : Packed , b : TransparentPacked , c : WrappedPacked ) ;
136
128
}
137
129
138
-
139
-
140
130
pub unsafe fn main (
141
- a1 : Align8 , a2 : Transparent8 , a3 : Wrapped8 ,
142
- b1 : Align16 , b2 : Transparent16 , b3 : Wrapped16 ,
143
- c1 : I128 , c2 : TransparentI128 , c3 : WrappedI128 ,
144
- d1 : Packed , d2 : TransparentPacked , d3 : WrappedPacked ,
131
+ a1 : Align8 ,
132
+ a2 : Transparent8 ,
133
+ a3 : Wrapped8 ,
134
+ b1 : Align16 ,
135
+ b2 : Transparent16 ,
136
+ b3 : Wrapped16 ,
137
+ c1 : I128 ,
138
+ c2 : TransparentI128 ,
139
+ c3 : WrappedI128 ,
140
+ d1 : Packed ,
141
+ d2 : TransparentPacked ,
142
+ d3 : WrappedPacked ,
145
143
) {
146
144
test_8 ( a1, a2, a3) ;
147
145
test_16 ( b1, b2, b3) ;
0 commit comments