about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/move-out-of-ref.stderr
blob: d443dc9d4831bfb960c4f82d4377b169d91e8e30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
error[E0507]: cannot move out of `*x` which is behind a shared reference
  --> $DIR/move-out-of-ref.rs:9:9
   |
LL | fn hello(x: &Ty) {
   |             --- move occurs because `*x` has type `Ty`, which does not implement the `Copy` trait
LL |     let c = async || {
LL |         *x;
   |         ^^ `*x` is moved here
   |
note: if `Ty` implemented `Clone`, you could clone the value
  --> $DIR/move-out-of-ref.rs:5:1
   |
LL | struct Ty;
   | ^^^^^^^^^ consider implementing `Clone` for this type
...
LL |         *x;
   |         -- you could clone this value

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0507`.