1 #![feature(negative_impls)] 2 #![deny(suspicious_auto_trait_impls)] 3 4 // https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.3A.20backlog.20bonanza/near/269471299 5 // https://github.com/taiki-e/pin-project/issues/340 6 7 #[pin_project::pin_project] 8 struct Foo<Pinned, Unpinned> { 9 #[pin] 10 pinned: Pinned, 11 12 unpinned: Unpinned, 13 } 14 15 struct MyPhantomPinned {} 16 impl !Unpin for MyPhantomPinned {} 17 impl Unpin for Foo<MyPhantomPinned, ()> {} 18 is_unpin<T: Unpin>()19fn is_unpin<T: Unpin>() {} 20 main()21fn main() { 22 is_unpin::<Foo<MyPhantomPinned, ()>>() 23 } 24