summary refs log tree commit diff
path: root/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr
blob: baf122df5e268e27515371644a682e728c23b11f (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
error[E0499]: cannot borrow `*f` as mutable more than once at a time
  --> $DIR/two-phase-nonrecv-autoref.rs:58:11
   |
LL |         f(f(10));
   |         - ^ second mutable borrow occurs here
   |         |
   |         first mutable borrow occurs here
   |         first borrow later used by call

error[E0382]: use of moved value: `f`
  --> $DIR/two-phase-nonrecv-autoref.rs:66:11
   |
LL |     fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
   |                                            - move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait
LL |         f(f(10));
   |         - ^ value used here after move
   |         |
   |         value moved here

error[E0499]: cannot borrow `*f` as mutable more than once at a time
  --> $DIR/two-phase-nonrecv-autoref.rs:72:11
   |
LL |         f(f(10));
   |         - ^ second mutable borrow occurs here
   |         |
   |         first mutable borrow occurs here
   |         first borrow later used by call

error[E0382]: use of moved value: `f`
  --> $DIR/two-phase-nonrecv-autoref.rs:80:11
   |
LL |     fn twice_ten_oo(f: Box<dyn FnOnce(i32) -> i32>) {
   |                     - move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
LL |         f(f(10));
   |         - ^ value used here after move
   |         |
   |         value moved here

error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:119:27
   |
LL |     double_access(&mut a, &a);
   |     ------------- ------  ^^ immutable borrow occurs here
   |     |             |
   |     |             mutable borrow occurs here
   |     mutable borrow later used by call

error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:145:7
   |
LL |     i[i[3]] = 4;
   |     --^----
   |     | |
   |     | immutable borrow occurs here
   |     mutable borrow occurs here
   |     mutable borrow later used here

error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:150:7
   |
LL |     i[i[3]] = i[4];
   |     --^----
   |     | |
   |     | immutable borrow occurs here
   |     mutable borrow occurs here
   |     mutable borrow later used here

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0382, E0499, E0502.
For more information about an error, try `rustc --explain E0382`.