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