about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0076.md
blob: b1943de63e5d4a4e52fe5b19f829ab70234531de (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
The type of the field in a tuple struct isn't an array when using the `#[simd]`
attribute.

Erroneous code example:

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

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

When using the `#[simd]` attribute to automatically use SIMD operations in tuple
structs, if you want a single-lane vector then the field must be a 1-element
array, or the compiler will trigger this error.

Fixed example:

```
#![feature(repr_simd)]

#[repr(simd)]
struct Good([u16; 1]); // ok!
```