|
| 1 | +error[E0382]: use of moved value: `pointee` |
| 2 | + --> $DIR/pin_move.rs:11:18 |
| 3 | + | |
| 4 | +LL | let mut pointee = NotCopy(PhantomPinned); |
| 5 | + | ----------- move occurs because `pointee` has type `a::NotCopy<PhantomPinned>`, which does not implement the `Copy` trait |
| 6 | +LL | pin!(pointee); |
| 7 | + | ------- value moved here |
| 8 | +LL | let _moved = pointee; |
| 9 | + | ^^^^^^^ value used here after move |
| 10 | + | |
| 11 | +note: if `a::NotCopy<PhantomPinned>` implemented `Clone`, you could clone the value |
| 12 | + --> $DIR/pin_move.rs:7:5 |
| 13 | + | |
| 14 | +LL | struct NotCopy<T>(T); |
| 15 | + | ^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type |
| 16 | +... |
| 17 | +LL | pin!(pointee); |
| 18 | + | ------- you could clone this value |
| 19 | + |
| 20 | +error[E0507]: cannot move out of a mutable reference |
| 21 | + --> $DIR/pin_move.rs:18:10 |
| 22 | + | |
| 23 | +LL | pin!(*&mut pointee); |
| 24 | + | ^^^^^^^^^^^^^ move occurs because value has type `b::NotCopy<PhantomPinned>`, which does not implement the `Copy` trait |
| 25 | + | |
| 26 | +note: if `b::NotCopy<PhantomPinned>` implemented `Clone`, you could clone the value |
| 27 | + --> $DIR/pin_move.rs:16:5 |
| 28 | + | |
| 29 | +LL | struct NotCopy<T>(T); |
| 30 | + | ^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type |
| 31 | +LL | let mut pointee = NotCopy(PhantomPinned); |
| 32 | +LL | pin!(*&mut pointee); |
| 33 | + | ------------- you could clone this value |
| 34 | + |
| 35 | +error: aborting due to 2 previous errors |
| 36 | + |
| 37 | +Some errors have detailed explanations: E0382, E0507. |
| 38 | +For more information about an error, try `rustc --explain E0382`. |
0 commit comments