1 use auxiliary_macro::hidden_repr; 2 use pin_project::{pin_project, pinned_drop, UnsafeUnpin}; 3 use std::pin::Pin; 4 5 #[pin_project] //~ ERROR may not be used on #[repr(packed)] types 6 #[hidden_repr(packed)] 7 struct A { 8 #[pin] 9 f: u32, 10 } 11 12 #[pin_project(UnsafeUnpin)] //~ ERROR may not be used on #[repr(packed)] types 13 #[hidden_repr(packed)] 14 struct C { 15 #[pin] 16 f: u32, 17 } 18 19 unsafe impl UnsafeUnpin for C {} 20 21 #[pin_project(PinnedDrop)] //~ ERROR may not be used on #[repr(packed)] types 22 #[hidden_repr(packed)] 23 struct D { 24 #[pin] 25 f: u32, 26 } 27 28 #[pinned_drop] 29 impl PinnedDrop for D { drop(self: Pin<&mut Self>)30 fn drop(self: Pin<&mut Self>) {} 31 } 32 main()33fn main() {} 34