Skip to content

Commit 82f9838

Browse files
quininermayah
authored andcommitted
fix: warning E0566 (#1)
Using multiple arguments to #[repr] does not work as we expected. See: rust-lang/rust#34622
1 parent 8c97ff0 commit 82f9838

File tree

1 file changed

+52
-26
lines changed

1 file changed

+52
-26
lines changed

src/lib.rs

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ unsafe fn bitcast<T, U>(x: T) -> U {
4747

4848
#[allow(non_camel_case_types)]
4949
#[derive(Debug, Copy, Clone)]
50-
#[repr(C, simd)]
50+
#[repr(simd)]
51+
#[repr(C)]
5152
pub struct m128i(i64, i64);
5253

5354
impl m128i {
@@ -78,7 +79,8 @@ impl m128i {
7879

7980
#[allow(non_camel_case_types)]
8081
#[derive(Debug, Copy, Clone)]
81-
#[repr(C, simd)]
82+
#[repr(simd)]
83+
#[repr(C)]
8284
pub struct m128(f32, f32, f32, f32);
8385

8486
impl m128 {
@@ -95,7 +97,8 @@ impl m128 {
9597

9698
#[allow(non_camel_case_types)]
9799
#[derive(Debug, Copy, Clone)]
98-
#[repr(C, simd)]
100+
#[repr(simd)]
101+
#[repr(C)]
99102
pub struct m128d(f64, f64);
100103

101104
impl m128d {
@@ -112,7 +115,8 @@ impl m128d {
112115

113116
#[allow(non_camel_case_types)]
114117
#[derive(Debug, Copy, Clone)]
115-
#[repr(C, simd)]
118+
#[repr(simd)]
119+
#[repr(C)]
116120
pub struct m256i(i32, i32, i32, i32, i32, i32, i32, i32);
117121

118122
impl m256i {
@@ -143,7 +147,8 @@ impl m256i {
143147

144148
#[allow(non_camel_case_types)]
145149
#[derive(Debug, Copy, Clone)]
146-
#[repr(C, simd)]
150+
#[repr(simd)]
151+
#[repr(C)]
147152
pub struct m256(f32, f32, f32, f32, f32, f32, f32, f32);
148153

149154
impl m256 {
@@ -160,7 +165,8 @@ impl m256 {
160165

161166
#[allow(non_camel_case_types)]
162167
#[derive(Debug, Copy, Clone)]
163-
#[repr(C, simd)]
168+
#[repr(simd)]
169+
#[repr(C)]
164170
pub struct m256d(f64, f64, f64, f64);
165171

166172
impl m256d {
@@ -177,103 +183,123 @@ impl m256d {
177183

178184
#[allow(non_camel_case_types)]
179185
#[derive(Debug, Copy, Clone)]
180-
#[repr(C, simd)]
186+
#[repr(simd)]
187+
#[repr(C)]
181188
pub struct i64x2(i64, i64);
182189

183190
#[allow(non_camel_case_types)]
184191
#[derive(Debug, Copy, Clone)]
185-
#[repr(C, simd)]
192+
#[repr(simd)]
193+
#[repr(C)]
186194
pub struct u64x2(u64, u64);
187195

188196
#[allow(non_camel_case_types)]
189197
#[derive(Debug, Copy, Clone)]
190-
#[repr(C, simd)]
198+
#[repr(simd)]
199+
#[repr(C)]
191200
pub struct f64x2(f64, f64);
192201

193202
#[allow(non_camel_case_types)]
194203
#[derive(Debug, Copy, Clone)]
195-
#[repr(C, simd)]
204+
#[repr(simd)]
205+
#[repr(C)]
196206
pub struct i32x4(i32, i32, i32, i32);
197207

198208
#[allow(non_camel_case_types)]
199209
#[derive(Debug, Copy, Clone)]
200-
#[repr(C, simd)]
210+
#[repr(simd)]
211+
#[repr(C)]
201212
pub struct u32x4(u32, u32, u32, u32);
202213

203214
#[allow(non_camel_case_types)]
204215
#[derive(Debug, Copy, Clone)]
205-
#[repr(C, simd)]
216+
#[repr(simd)]
217+
#[repr(C)]
206218
pub struct f32x4(f32, f32, f32, f32);
207219

208220
#[allow(non_camel_case_types)]
209221
#[derive(Debug, Copy, Clone)]
210-
#[repr(C, simd)]
222+
#[repr(simd)]
223+
#[repr(C)]
211224
pub struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
212225

213226
#[allow(non_camel_case_types)]
214227
#[derive(Debug, Copy, Clone)]
215-
#[repr(C, simd)]
228+
#[repr(simd)]
229+
#[repr(C)]
216230
pub struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16);
217231

218232
#[allow(non_camel_case_types)]
219233
#[derive(Debug, Copy, Clone)]
220-
#[repr(C, simd)]
234+
#[repr(simd)]
235+
#[repr(C)]
221236
pub struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8);
222237

223238
#[allow(non_camel_case_types)]
224239
#[derive(Debug, Copy, Clone)]
225-
#[repr(C, simd)]
240+
#[repr(simd)]
241+
#[repr(C)]
226242
pub struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8);
227243

228244
#[allow(non_camel_case_types)]
229245
#[derive(Debug, Copy, Clone)]
230-
#[repr(C, simd)]
246+
#[repr(simd)]
247+
#[repr(C)]
231248
pub struct i64x4(i64, i64, i64, i64);
232249

233250
#[allow(non_camel_case_types)]
234251
#[derive(Debug, Copy, Clone)]
235-
#[repr(C, simd)]
252+
#[repr(simd)]
253+
#[repr(C)]
236254
pub struct u64x4(u64, u64, u64, u64);
237255

238256
#[allow(non_camel_case_types)]
239257
#[derive(Debug, Copy, Clone)]
240-
#[repr(C, simd)]
258+
#[repr(simd)]
259+
#[repr(C)]
241260
pub struct f64x4(f64, f64, f64, f64);
242261

243262
#[allow(non_camel_case_types)]
244263
#[derive(Debug, Copy, Clone)]
245-
#[repr(C, simd)]
264+
#[repr(simd)]
265+
#[repr(C)]
246266
pub struct i32x8(i32, i32, i32, i32, i32, i32, i32, i32);
247267

248268
#[allow(non_camel_case_types)]
249269
#[derive(Debug, Copy, Clone)]
250-
#[repr(C, simd)]
270+
#[repr(simd)]
271+
#[repr(C)]
251272
pub struct u32x8(u32, u32, u32, u32, u32, u32, u32, u32);
252273

253274
#[allow(non_camel_case_types)]
254275
#[derive(Debug, Copy, Clone)]
255-
#[repr(C, simd)]
276+
#[repr(simd)]
277+
#[repr(C)]
256278
pub struct f32x8(f32, f32, f32, f32, f32, f32, f32, f32);
257279

258280
#[allow(non_camel_case_types)]
259281
#[derive(Debug, Copy, Clone)]
260-
#[repr(C, simd)]
282+
#[repr(simd)]
283+
#[repr(C)]
261284
pub struct i16x16(i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16);
262285

263286
#[allow(non_camel_case_types)]
264287
#[derive(Debug, Copy, Clone)]
265-
#[repr(C, simd)]
288+
#[repr(simd)]
289+
#[repr(C)]
266290
pub struct u16x16(u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16, u16);
267291

268292
#[allow(non_camel_case_types)]
269293
#[derive(Debug, Copy, Clone)]
270-
#[repr(C, simd)]
294+
#[repr(simd)]
295+
#[repr(C)]
271296
pub struct i8x32(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8,
272297
i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8);
273298

274299
#[allow(non_camel_case_types)]
275300
#[derive(Debug, Copy, Clone)]
276-
#[repr(C, simd)]
301+
#[repr(simd)]
302+
#[repr(C)]
277303
pub struct u8x32(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8,
278304
u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8);
279305

0 commit comments

Comments
 (0)