mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00
23 lines
701 B
Plaintext
23 lines
701 B
Plaintext
error[E0505]: cannot move out of `v` because it is borrowed
|
|
--> $DIR/drop-live-upvar.rs:19:10
|
|
|
|
|
LL | let v = vec![1, 2, 3];
|
|
| - binding `v` declared here
|
|
LL | let x = NeedsDrop(&v);
|
|
| -- borrow of `v` occurs here
|
|
...
|
|
LL | drop(v);
|
|
| ^ move out of `v` occurs here
|
|
LL |
|
|
LL | }
|
|
| - borrow might be used here, when `c` is dropped and runs the destructor for coroutine
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
LL | let x = NeedsDrop(&v.clone());
|
|
| ++++++++
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0505`.
|