about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0075.md
blob: b58018eafc30c038771ae5ff8af24dcfdb28715d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
A `#[simd]` attribute was applied to an empty or multi-field struct.

Erroneous code examples:

```compile_fail,E0075
#![feature(repr_simd)]

#[repr(simd)]
struct Bad; // error!
```

```compile_fail,E0075
#![feature(repr_simd)]

#[repr(simd)]
struct Bad([u32; 1], [u32; 1]); // error!
```

The `#[simd]` attribute can only be applied to a single-field struct, because
the one field must be the array of values in the vector.

Fixed example:

```
#![feature(repr_simd)]

#[repr(simd)]
struct Good([u32; 2]); // ok!
```