1 use pin_project::pin_project;
2
3 #[pin_project(UnsafeUnpin)] //~ ERROR E0119
4 struct Foo<T, U> {
5 #[pin]
6 f1: T,
7 f2: U,
8 }
9
10 impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
11
12 #[pin_project(UnsafeUnpin)] //~ ERROR E0119
13 struct Bar<T, U> {
14 #[pin]
15 f1: T,
16 f2: U,
17 }
18
19 impl<T, U> Unpin for Bar<T, U> {}
20
21 #[pin_project(UnsafeUnpin)] //~ ERROR E0119
22 struct Baz<T, U> {
23 #[pin]
24 f1: T,
25 f2: U,
26 }
27
28 impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {}
29
main()30 fn main() {}
31