Clean up E0077 long explanation
This commit is contained in:
parent
843869c690
commit
97a1653f09
1 changed files with 9 additions and 6 deletions
|
|
@ -1,20 +1,23 @@
|
|||
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.
|
||||
A tuple struct's element isn't a machine type when using the `#[simd]`
|
||||
attribute.
|
||||
|
||||
This will cause an error:
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0077
|
||||
#![feature(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)]
|
||||
|
||||
#[repr(simd)]
|
||||
struct Good(u32, u32, u32);
|
||||
struct Good(u32, u32, u32); // ok!
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue