1 // Note: If you change this test, change 'marker_trait_attr-feature-gate.rs' at the same time. 2 3 // marker_trait_attr 4 // Tracking issue: https://github.com/rust-lang/rust/issues/29864 5 #![feature(marker_trait_attr)] 6 7 // See https://github.com/taiki-e/pin-project/issues/105#issuecomment-535355974 8 9 use std::marker::PhantomPinned; 10 11 use pin_project::pin_project; 12 13 #[pin_project] //~ ERROR E0119 14 struct Struct<T> { 15 #[pin] 16 f: T, 17 } 18 19 // unsound Unpin impl 20 impl<T> Unpin for Struct<T> {} 21 is_unpin<T: Unpin>()22fn is_unpin<T: Unpin>() {} 23 main()24fn main() { 25 is_unpin::<Struct<PhantomPinned>>() 26 } 27