|
1 | 1 | #![no_std]
|
2 | 2 |
|
3 | 3 | // Combinations of `#[repr(..)]` attributes.
|
| 4 | +// Rustdoc JSON emits normalized output, regardless of the original source. |
4 | 5 |
|
5 |
| -//@ is "$.index[?(@.name=='ReprCI8')].attrs" '["#[attr = Repr([ReprC, ReprInt(SignedInt(I8))])]\n"]' |
| 6 | +//@ is "$.index[?(@.name=='ReprCI8')].attrs" '["#[repr(C, i8)]"]' |
6 | 7 | #[repr(C, i8)]
|
7 | 8 | pub enum ReprCI8 {
|
8 | 9 | First,
|
9 | 10 | }
|
10 | 11 |
|
11 |
| -//@ is "$.index[?(@.name=='SeparateReprCI16')].attrs" '["#[attr = Repr([ReprC, ReprInt(SignedInt(I16))])]\n"]' |
| 12 | +//@ is "$.index[?(@.name=='SeparateReprCI16')].attrs" '["#[repr(C, i16)]"]' |
12 | 13 | #[repr(C)]
|
13 | 14 | #[repr(i16)]
|
14 | 15 | pub enum SeparateReprCI16 {
|
15 | 16 | First,
|
16 | 17 | }
|
17 | 18 |
|
18 |
| -//@ is "$.index[?(@.name=='ReversedReprCUsize')].attrs" '["#[attr = Repr([ReprInt(UnsignedInt(Usize)), ReprC])]\n"]' |
| 19 | +//@ is "$.index[?(@.name=='ReversedReprCUsize')].attrs" '["#[repr(C, usize)]"]' |
19 | 20 | #[repr(usize, C)]
|
20 | 21 | pub enum ReversedReprCUsize {
|
21 | 22 | First,
|
22 | 23 | }
|
23 | 24 |
|
24 |
| -//@ is "$.index[?(@.name=='ReprCPacked')].attrs" '["#[attr = Repr([ReprC, ReprPacked(Align(1 bytes))])]\n"]' |
| 25 | +//@ is "$.index[?(@.name=='ReprCPacked')].attrs" '["#[repr(C, packed(1))]"]' |
25 | 26 | #[repr(C, packed)]
|
26 | 27 | pub struct ReprCPacked {
|
27 | 28 | a: i8,
|
28 | 29 | b: i64,
|
29 | 30 | }
|
30 | 31 |
|
31 |
| -//@ is "$.index[?(@.name=='SeparateReprCPacked')].attrs" '["#[attr = Repr([ReprC, ReprPacked(Align(2 bytes))])]\n"]' |
| 32 | +//@ is "$.index[?(@.name=='SeparateReprCPacked')].attrs" '["#[repr(C, packed(2))]"]' |
32 | 33 | #[repr(C)]
|
33 | 34 | #[repr(packed(2))]
|
34 | 35 | pub struct SeparateReprCPacked {
|
35 | 36 | a: i8,
|
36 | 37 | b: i64,
|
37 | 38 | }
|
38 | 39 |
|
39 |
| -//@ is "$.index[?(@.name=='ReversedReprCPacked')].attrs" '["#[attr = Repr([ReprPacked(Align(2 bytes)), ReprC])]\n"]' |
| 40 | +//@ is "$.index[?(@.name=='ReversedReprCPacked')].attrs" '["#[repr(C, packed(2))]"]' |
40 | 41 | #[repr(packed(2), C)]
|
41 | 42 | pub struct ReversedReprCPacked {
|
42 | 43 | a: i8,
|
43 | 44 | b: i64,
|
44 | 45 | }
|
45 | 46 |
|
46 |
| -//@ is "$.index[?(@.name=='ReprCAlign')].attrs" '["#[attr = Repr([ReprC, ReprAlign(Align(16 bytes))])]\n"]' |
| 47 | +//@ is "$.index[?(@.name=='ReprCAlign')].attrs" '["#[repr(C, align(16))]"]' |
47 | 48 | #[repr(C, align(16))]
|
48 | 49 | pub struct ReprCAlign {
|
49 | 50 | a: i8,
|
50 | 51 | b: i64,
|
51 | 52 | }
|
52 | 53 |
|
53 |
| -//@ is "$.index[?(@.name=='SeparateReprCAlign')].attrs" '["#[attr = Repr([ReprC, ReprAlign(Align(2 bytes))])]\n"]' |
| 54 | +//@ is "$.index[?(@.name=='SeparateReprCAlign')].attrs" '["#[repr(C, align(2))]"]' |
54 | 55 | #[repr(C)]
|
55 | 56 | #[repr(align(2))]
|
56 | 57 | pub struct SeparateReprCAlign {
|
57 | 58 | a: i8,
|
58 | 59 | b: i64,
|
59 | 60 | }
|
60 | 61 |
|
61 |
| -//@ is "$.index[?(@.name=='ReversedReprCAlign')].attrs" '["#[attr = Repr([ReprAlign(Align(2 bytes)), ReprC])]\n"]' |
| 62 | +//@ is "$.index[?(@.name=='ReversedReprCAlign')].attrs" '["#[repr(C, align(2))]"]' |
62 | 63 | #[repr(align(2), C)]
|
63 | 64 | pub struct ReversedReprCAlign {
|
64 | 65 | a: i8,
|
65 | 66 | b: i64,
|
66 | 67 | }
|
67 | 68 |
|
68 |
| -//@ is "$.index[?(@.name=='AlignedExplicitRepr')].attrs" '["#[attr = Repr([ReprC, ReprAlign(Align(16 bytes)), ReprInt(SignedInt(Isize))])]\n"]' |
| 69 | +//@ is "$.index[?(@.name=='AlignedExplicitRepr')].attrs" '["#[repr(C, align(16), isize)]"]' |
69 | 70 | #[repr(C, align(16), isize)]
|
70 | 71 | pub enum AlignedExplicitRepr {
|
71 | 72 | First,
|
72 | 73 | }
|
73 | 74 |
|
74 |
| -//@ is "$.index[?(@.name=='ReorderedAlignedExplicitRepr')].attrs" '["#[attr = Repr([ReprInt(SignedInt(Isize)), ReprC, ReprAlign(Align(16 bytes))])]\n"]' |
| 75 | +//@ is "$.index[?(@.name=='ReorderedAlignedExplicitRepr')].attrs" '["#[repr(C, align(16), isize)]"]' |
75 | 76 | #[repr(isize, C, align(16))]
|
76 | 77 | pub enum ReorderedAlignedExplicitRepr {
|
77 | 78 | First,
|
|
0 commit comments