rust/tests/ui/nll/closure-move-spans.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-08-01 19:40:06 +00:00
error[E0382]: use of moved value: `x`
--> $DIR/closure-move-spans.rs:5:13
2018-08-01 19:40:06 +00:00
|
LL | fn move_after_move(x: String) {
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
2018-08-01 19:40:06 +00:00
LL | || x;
| -- - variable moved due to use in closure
| |
| value moved into closure here
2019-03-09 12:03:44 +00:00
LL | let y = x;
2018-08-01 19:40:06 +00:00
| ^ value used here after move
error[E0382]: borrow of moved value: `x`
--> $DIR/closure-move-spans.rs:10:13
2018-08-01 19:40:06 +00:00
|
LL | fn borrow_after_move(x: String) {
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
2018-08-01 19:40:06 +00:00
LL | || x;
| -- - variable moved due to use in closure
| |
| value moved into closure here
2019-03-09 12:03:44 +00:00
LL | let y = &x;
2018-08-01 19:40:06 +00:00
| ^^ value borrowed here after move
error[E0382]: borrow of moved value: `x`
--> $DIR/closure-move-spans.rs:15:13
2018-08-01 19:40:06 +00:00
|
LL | fn borrow_mut_after_move(mut x: String) {
| ----- move occurs because `x` has type `String`, which does not implement the `Copy` trait
2018-08-01 19:40:06 +00:00
LL | || x;
| -- - variable moved due to use in closure
| |
| value moved into closure here
2019-03-09 12:03:44 +00:00
LL | let y = &mut x;
2018-08-01 19:40:06 +00:00
| ^^^^^^ value borrowed here after move
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0382`.