Debian Codegraph @

debian/missing-sources/pin-project-lite/tests/ui/pin_project/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 struct Foo<Pinned, Unpinned> {
7 #[pin]
8 pinned: Pinned,
9 unpinned: Unpinned,
10 }
11 }
12
13 struct MyPhantomPinned(::core::marker::PhantomPinned);
14 impl Unpin for MyPhantomPinned where for<'cursed> str: Sized {}
15 impl Unpin for Foo<MyPhantomPinned, ()> {}
16
17 fn is_unpin<T: Unpin>() {}
18
19 fn main() {
20 is_unpin::<Foo<MyPhantomPinned, ()>>()
21 }