]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unop-move-semantics.nll.stderr
Unit test from #57866.
[rust.git] / src / test / ui / unop-move-semantics.nll.stderr
1 error[E0382]: borrow of moved value: `x`
2   --> $DIR/unop-move-semantics.rs:8:5
3    |
4 LL |     !x;
5    |      - value moved here
6 LL | 
7 LL |     x.clone();  //~ ERROR: use of moved value
8    |     ^ value borrowed here after move
9    |
10    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
11
12 error[E0505]: cannot move out of `x` because it is borrowed
13   --> $DIR/unop-move-semantics.rs:15:6
14    |
15 LL |     let m = &x;
16    |             -- borrow of `x` occurs here
17 ...
18 LL |     !x;  //~ ERROR: cannot move out of `x` because it is borrowed
19    |      ^ move out of `x` occurs here
20 ...
21 LL |     use_mut(n); use_imm(m);
22    |                         - borrow later used here
23
24 error[E0505]: cannot move out of `y` because it is borrowed
25   --> $DIR/unop-move-semantics.rs:17:6
26    |
27 LL |     let n = &mut y;
28    |             ------ borrow of `y` occurs here
29 ...
30 LL |     !y;  //~ ERROR: cannot move out of `y` because it is borrowed
31    |      ^ move out of `y` occurs here
32 LL |     use_mut(n); use_imm(m);
33    |             - borrow later used here
34
35 error[E0507]: cannot move out of borrowed content
36   --> $DIR/unop-move-semantics.rs:24:6
37    |
38 LL |     !*m;  //~ ERROR: cannot move out of borrowed content
39    |      ^^ cannot move out of borrowed content
40
41 error[E0507]: cannot move out of borrowed content
42   --> $DIR/unop-move-semantics.rs:26:6
43    |
44 LL |     !*n;  //~ ERROR: cannot move out of borrowed content
45    |      ^^ cannot move out of borrowed content
46
47 error: aborting due to 5 previous errors
48
49 Some errors occurred: E0382, E0505, E0507.
50 For more information about an error, try `rustc --explain E0382`.