File: type-len.rs

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,245,420 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (39 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (8)
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
30
31
32
33
34
35
36
37
38
39
#![feature(repr_simd)]
#![allow(non_camel_case_types)]


#[repr(simd)]
struct empty; //~ ERROR SIMD vector cannot be empty

#[repr(simd)]
struct empty2([f32; 0]); //~ ERROR SIMD vector cannot be empty

#[repr(simd)]
struct pow2([f32; 7]);

#[repr(simd)]
struct i64f64(i64, f64); //~ ERROR SIMD vector should be homogeneous

struct Foo;

#[repr(simd)]
struct FooV(Foo, Foo); //~ ERROR SIMD vector element type should be a primitive scalar (integer/float/pointer) type

#[repr(simd)]
struct FooV2([Foo; 2]); //~ ERROR SIMD vector element type should be a primitive scalar (integer/float/pointer) type

#[repr(simd)]
struct TooBig([f32; 65536]); //~ ERROR SIMD vector cannot have more than 32768 elements

#[repr(simd)]
struct JustRight([u128; 32768]);

#[repr(simd)]
struct RGBA {
    r: f32,
    g: f32,
    b: f32,
    a: f32
}

fn main() {}