about summary refs log tree commit diff
path: root/tests/ui/coroutine/moved-twice.stderr
blob: 2b21f6c59f0bca42599ce697113e51a53aa86789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error[E0382]: use of moved value: `first`
  --> $DIR/moved-twice.rs:21:22
   |
LL |         let first = Foo([0; FOO_SIZE]);
   |             ----- move occurs because `first` has type `Foo`, which does not implement the `Copy` trait
LL |         yield;
LL |         let second = first;
   |                      ----- value moved here
LL |         yield;
LL |         let second = first;
   |                      ^^^^^ value used here after move
   |
note: if `Foo` implemented `Clone`, you could clone the value
  --> $DIR/moved-twice.rs:9:1
   |
LL | struct Foo([u8; FOO_SIZE]);
   | ^^^^^^^^^^ consider implementing `Clone` for this type
...
LL |         let second = first;
   |                      ----- you could clone this value

error: aborting due to 1 previous error

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