]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/pin-needed-to-poll-2.stderr
Auto merge of #87262 - dtolnay:negative, r=Aaron1011
[rust.git] / src / test / ui / async-await / pin-needed-to-poll-2.stderr
1 error[E0277]: `PhantomPinned` cannot be unpinned
2   --> $DIR/pin-needed-to-poll-2.rs:43:9
3    |
4 LL |         Pin::new(&mut self.sleep).poll(cx)
5    |         ^^^^^^^^ within `Sleep`, the trait `Unpin` is not implemented for `PhantomPinned`
6    |
7    = note: consider using `Box::pin`
8 note: required because it appears within the type `Sleep`
9   --> $DIR/pin-needed-to-poll-2.rs:8:8
10    |
11 LL | struct Sleep(std::marker::PhantomPinned);
12    |        ^^^^^
13 note: required by `Pin::<P>::new`
14   --> $SRC_DIR/core/src/pin.rs:LL:COL
15    |
16 LL |     pub const fn new(pointer: P) -> Pin<P> {
17    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0277`.