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