A #[simd] attribute was applied to an empty or multi-field struct.
Erroneous code examples:
#![allow(unused)]
#![feature(repr_simd)]
fn main() {
#[repr(simd)]
struct Bad; // error!
} #![allow(unused)]
#![feature(repr_simd)]
fn main() {
#[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:
#![allow(unused)]
#![feature(repr_simd)]
fn main() {
#[repr(simd)]
struct Good([u32; 2]); // ok!
}
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0075.html