| 1 |
error[E0277]: `PhantomPinned` cannot be unpinned |
| 2 |
--> tests/ui/pin_project/overlapping_unpin_struct.rs:21:16 |
| 3 |
| |
| 4 |
21 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277 |
| 5 |
| ^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` |
| 6 |
| |
| 7 |
= note: consider using the `pin!` macro |
| 8 |
consider using `Box::pin` if you need to access the pinned value outside of the current scope |
| 9 |
note: required because it appears within the type `_::__Origin<'_, PhantomPinned>` |
| 10 |
--> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1 |
| 11 |
| |
| 12 |
7 | / pin_project! { |
| 13 |
8 | | struct Foo<T> { |
| 14 |
9 | | #[pin] |
| 15 |
10 | | inner: T, |
| 16 |
11 | | } |
| 17 |
12 | | } |
| 18 |
| |_^ |
| 19 |
note: required for `Foo<PhantomPinned>` to implement `Unpin` |
| 20 |
--> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1 |
| 21 |
| |
| 22 |
7 | / pin_project! { |
| 23 |
8 | | struct Foo<T> { |
| 24 |
9 | | #[pin] |
| 25 |
10 | | inner: T, |
| 26 |
11 | | } |
| 27 |
12 | | } |
| 28 |
| |_^ unsatisfied trait bound introduced here |
| 29 |
note: required by a bound in `is_unpin` |
| 30 |
--> tests/ui/pin_project/overlapping_unpin_struct.rs:18:16 |
| 31 |
| |
| 32 |
18 | fn is_unpin<T: Unpin>() {} |
| 33 |
| ^^^^^ required by this bound in `is_unpin` |
| 34 |
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |