A tuple struct's element isn't a machine type when using the #[simd] attribute.
Erroneous code example:
#![allow(unused)]
#![feature(repr_simd)]
fn main() {
#[repr(simd)]
struct Bad([String; 2]); // error!
} 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:
#![allow(unused)]
#![feature(repr_simd)]
fn main() {
#[repr(simd)]
struct Good([u32; 4]); // 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/E0077.html