]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | A tuple struct's element isn't a machine type when using the `#[simd]` |
2 | attribute. | |
3 | ||
4 | Erroneous code example: | |
5 | ||
6 | ```compile_fail,E0077 | |
7 | #![feature(repr_simd)] | |
8 | ||
9 | #[repr(simd)] | |
10 | struct Bad(String); // error! | |
11 | ``` | |
12 | ||
13 | When using the `#[simd]` attribute on a tuple struct, the elements in the tuple | |
14 | must be machine types so SIMD operations can be applied to them. | |
15 | ||
16 | Fixed example: | |
17 | ||
18 | ``` | |
19 | #![feature(repr_simd)] | |
20 | ||
21 | #[repr(simd)] | |
6a06907d | 22 | struct Good(u32, u32, u32, u32); // ok! |
60c5eb7d | 23 | ``` |