]> git.lizzy.rs Git - rust.git/blob - src/test/ui/attr-usage-repr.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / attr-usage-repr.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![feature(repr_simd)]
12
13 #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
14 fn f() {}
15
16 #[repr(C)]
17 struct SExtern(f64, f64);
18
19 #[repr(packed)]
20 struct SPacked(f64, f64);
21
22 #[repr(simd)]
23 struct SSimd(f64, f64);
24
25 #[repr(i8)] //~ ERROR: attribute should be applied to enum
26 struct SInt(f64, f64);
27
28 #[repr(C)]
29 enum EExtern { A, B }
30
31 #[repr(align(8))] //~ ERROR: attribute should be applied to struct
32 enum EAlign { A, B }
33
34 #[repr(packed)] //~ ERROR: attribute should be applied to struct
35 enum EPacked { A, B }
36
37 #[repr(simd)] //~ ERROR: attribute should be applied to struct
38 enum ESimd { A, B }
39
40 #[repr(i8)]
41 enum EInt { A, B }
42
43 fn main() {}