Debian Codegraph @

third_party/rust/pin-project/tests/ui/pin_project/packed.rs

raw
1 use pin_project::pin_project;
2
3 #[pin_project]
4 #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
5 struct Packed1 {
6 #[pin]
7 f: u8,
8 }
9
10 // Test putting 'repr' before the 'pin_project' attribute
11 #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
12 #[pin_project]
13 struct Packed2 {
14 #[pin]
15 f: u8,
16 }
17
18 #[pin_project]
19 #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types
20 struct PackedN1 {
21 #[pin]
22 f: u32,
23 }
24
25 // Test putting 'repr' before the 'pin_project' attribute
26 #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types
27 #[pin_project]
28 struct PackedN2 {
29 #[pin]
30 f: u32,
31 }
32
33 fn main() {}