| 1 |
// SPDX-License-Identifier: Apache-2.0 OR MIT |
| 2 |
|
| 3 |
use pin_project_lite::pin_project; |
| 4 |
|
| 5 |
pin_project! { |
| 6 |
#[project(!Unpin)] |
| 7 |
struct Foo<T, U> { |
| 8 |
#[pin] |
| 9 |
f1: T, |
| 10 |
f2: U, |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
impl<T, U> Unpin for Foo<T, U> where T: Unpin {} |
| 15 |
|
| 16 |
pin_project! { |
| 17 |
#[project(!Unpin)] |
| 18 |
struct Bar<T, U> { |
| 19 |
#[pin] |
| 20 |
f1: T, |
| 21 |
f2: U, |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
impl<T, U> Unpin for Bar<T, U> {} |
| 26 |
|
| 27 |
pin_project! { |
| 28 |
#[project(!Unpin)] |
| 29 |
struct Baz<T, U> { |
| 30 |
#[pin] |
| 31 |
f1: T, |
| 32 |
f2: U, |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} |
| 37 |
|
| 38 |
fn main() {} |