1 // See ./pinned_drop-expanded.rs for generated code. 2 3 #![allow(dead_code)] 4 5 use std::pin::Pin; 6 7 use pin_project::{pin_project, pinned_drop}; 8 9 #[pin_project(PinnedDrop)] 10 pub struct Struct<'a, T> { 11 was_dropped: &'a mut bool, 12 #[pin] 13 field: T, 14 } 15 16 #[pinned_drop] 17 impl<T> PinnedDrop for Struct<'_, T> { drop(self: Pin<&mut Self>)18 fn drop(self: Pin<&mut Self>) { 19 **self.project().was_dropped = true; 20 } 21 } 22 main()23fn main() {} 24