]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | All types in a tuple struct aren't the same when using the `#[simd]` |
2 | attribute. | |
3 | ||
4 | Erroneous code example: | |
5 | ||
6 | ```compile_fail,E0076 | |
7 | #![feature(repr_simd)] | |
8 | ||
9 | #[repr(simd)] | |
6a06907d | 10 | struct Bad(u16, u32, u32 u32); // error! |
60c5eb7d XL |
11 | ``` |
12 | ||
13 | When using the `#[simd]` attribute to automatically use SIMD operations in tuple | |
14 | struct, the types in the struct must all be of the same type, or the compiler | |
15 | will trigger this error. | |
16 | ||
17 | Fixed example: | |
18 | ||
19 | ``` | |
20 | #![feature(repr_simd)] | |
21 | ||
22 | #[repr(simd)] | |
6a06907d | 23 | struct Good(u32, u32, u32, u32); // ok! |
60c5eb7d | 24 | ``` |