Skip to content

Commit 97a1653

Browse files
Clean up E0077 long explanation
1 parent 843869c commit 97a1653

File tree

1 file changed

+9
-6
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+9
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
When using the `#[simd]` attribute on a tuple struct, the elements in the tuple
2-
must be machine types so SIMD operations can be applied to them.
1+
A tuple struct's element isn't a machine type when using the `#[simd]`
2+
attribute.
33

4-
This will cause an error:
4+
Erroneous code example:
55

66
```compile_fail,E0077
77
#![feature(repr_simd)]
88
99
#[repr(simd)]
10-
struct Bad(String);
10+
struct Bad(String); // error!
1111
```
1212

13-
This will not:
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:
1417

1518
```
1619
#![feature(repr_simd)]
1720
1821
#[repr(simd)]
19-
struct Good(u32, u32, u32);
22+
struct Good(u32, u32, u32); // ok!
2023
```

0 commit comments

Comments
 (0)