]> git.proxmox.com Git - rustc.git/blob - src/test/ui/attr-usage-repr.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / attr-usage-repr.rs
1 #![feature(repr_simd)]
2 #![feature(repr_align_enum)]
3
4 #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
5 fn f() {}
6
7 #[repr(C)]
8 struct SExtern(f64, f64);
9
10 #[repr(packed)]
11 struct SPacked(f64, f64);
12
13 #[repr(simd)]
14 struct SSimd(f64, f64);
15
16 #[repr(i8)] //~ ERROR: attribute should be applied to enum
17 struct SInt(f64, f64);
18
19 #[repr(C)]
20 enum EExtern { A, B }
21
22 #[repr(align(8))]
23 enum EAlign { A, B }
24
25 #[repr(packed)] //~ ERROR: attribute should be applied to struct
26 enum EPacked { A, B }
27
28 #[repr(simd)] //~ ERROR: attribute should be applied to struct
29 enum ESimd { A, B }
30
31 #[repr(i8)]
32 enum EInt { A, B }
33
34 fn main() {}