Clean up E0077 long explanation

This commit is contained in:
Guillaume Gomez 2019-11-26 13:47:06 +01:00
parent 843869c690
commit 97a1653f09

View file

@ -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!
```