Debian Codegraph @

vendor/pin-project-lite/tests/ui/not_unpin/negative_impls_stable.rs

raw
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
2
3 // https://github.com/taiki-e/pin-project/issues/340#issuecomment-2428002670
4
5 pin_project_lite::pin_project! {
6 #[project(!Unpin)]
7 struct Foo<Pinned, Unpinned> {
8 #[pin]
9 pinned: Pinned,
10 unpinned: Unpinned,
11 }
12 }
13
14 struct MyPhantomPinned(::core::marker::PhantomPinned);
15 impl Unpin for MyPhantomPinned where for<'cursed> str: Sized {}
16 impl Unpin for Foo<MyPhantomPinned, ()> {}
17
18 fn is_unpin<T: Unpin>() {}
19
20 fn main() {
21 is_unpin::<Foo<MyPhantomPinned, ()>>()
22 }