]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-move-spans.stderr
Auto merge of #105121 - oli-obk:simpler-cheaper-dump_mir, r=nnethercote
[rust.git] / src / test / ui / nll / closure-move-spans.stderr
1 error[E0382]: use of moved value: `x`
2   --> $DIR/closure-move-spans.rs:5:13
3    |
4 LL | fn move_after_move(x: String) {
5    |                    - move occurs because `x` has type `String`, which does not implement the `Copy` trait
6 LL |     || x;
7    |     -- - variable moved due to use in closure
8    |     |
9    |     value moved into closure here
10 LL |     let y = x;
11    |             ^ value used here after move
12
13 error[E0382]: borrow of moved value: `x`
14   --> $DIR/closure-move-spans.rs:10:13
15    |
16 LL | fn borrow_after_move(x: String) {
17    |                      - move occurs because `x` has type `String`, which does not implement the `Copy` trait
18 LL |     || x;
19    |     -- - variable moved due to use in closure
20    |     |
21    |     value moved into closure here
22 LL |     let y = &x;
23    |             ^^ value borrowed here after move
24
25 error[E0382]: borrow of moved value: `x`
26   --> $DIR/closure-move-spans.rs:15:13
27    |
28 LL | fn borrow_mut_after_move(mut x: String) {
29    |                          ----- move occurs because `x` has type `String`, which does not implement the `Copy` trait
30 LL |     || x;
31    |     -- - variable moved due to use in closure
32    |     |
33    |     value moved into closure here
34 LL |     let y = &mut x;
35    |             ^^^^^^ value borrowed here after move
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0382`.