1 // SPDX-License-Identifier: Apache-2.0 OR MIT 2 3 // Note: If you change this test, change 'marker_trait_attr.rs' at the same time. 4 5 use std::marker::PhantomPinned; 6 7 use pin_project::pin_project; 8 9 #[pin_project] //~ ERROR E0119 10 struct Struct<T> { 11 #[pin] 12 f: T, 13 } 14 15 // unsound Unpin impl 16 impl<T> Unpin for Struct<T> {} 17 is_unpin<T: Unpin>()18fn is_unpin<T: Unpin>() {} 19 main()20fn main() { 21 is_unpin::<Struct<PhantomPinned>>() 22 } 23