-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
843869c
commit 97a1653
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,20 +1,23 @@ | |||
When using the `#[simd]` attribute on a tuple struct, the elements in the tuple | A tuple struct's element isn't a machine type when using the `#[simd]` | ||
must be machine types so SIMD operations can be applied to them. | attribute. | ||
|
|
||
This will cause an error: | Erroneous code example: | ||
|
|
||
```compile_fail,E0077 | ```compile_fail,E0077 | ||
#![feature(repr_simd)] | #![feature(repr_simd)] | ||
#[repr(simd)] | #[repr(simd)] | ||
struct Bad(String); | struct Bad(String); // error! | ||
``` | ``` | ||
|
|
||
This will not: | When using the `#[simd]` attribute on a tuple struct, the elements in the tuple | ||
must be machine types so SIMD operations can be applied to them. | |||
|
|||
Fixed example: | |||
|
|
||
``` | ``` | ||
#![feature(repr_simd)] | #![feature(repr_simd)] | ||
#[repr(simd)] | #[repr(simd)] | ||
struct Good(u32, u32, u32); | struct Good(u32, u32, u32); // ok! | ||
``` | ``` |