1 use pin_project::pin_project;
2
3 // The same implementation.
4
5 #[pin_project] //~ ERROR E0119
6 struct Foo<T, U> {
7 #[pin]
8 f1: T,
9 f2: U,
10 }
11
12 // conflicting implementations
13 impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
14
15 // The implementation that under different conditions.
16
17 #[pin_project] //~ ERROR E0119
18 struct Bar<T, U> {
19 #[pin]
20 f1: T,
21 f2: U,
22 }
23
24 // conflicting implementations
25 impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
26
27 #[pin_project] //~ ERROR E0119
28 struct Baz<T, U> {
29 #[pin]
30 f1: T,
31 f2: U,
32 }
33
34 // conflicting implementations
35 impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
36
main()37 fn main() {}
38