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