]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr
Unit test from #57866.
[rust.git] / src / test / ui / borrowck / two-phase-nonrecv-autoref.nll.stderr
1 error[E0499]: cannot borrow `*f` as mutable more than once at a time
2   --> $DIR/two-phase-nonrecv-autoref.rs:60:11
3    |
4 LL |         f(f(10));
5    |         - ^ second mutable borrow occurs here
6    |         |
7    |         first mutable borrow occurs here
8    |         first borrow later used by call
9
10 error[E0382]: use of moved value: `*f`
11   --> $DIR/two-phase-nonrecv-autoref.rs:69:11
12    |
13 LL |         f(f(10));
14    |         - ^ value used here after move
15    |         |
16    |         value moved here
17    |
18    = note: move occurs because `*f` has type `F`, which does not implement the `Copy` trait
19
20 error[E0499]: cannot borrow `*f` as mutable more than once at a time
21   --> $DIR/two-phase-nonrecv-autoref.rs:76:11
22    |
23 LL |         f(f(10));
24    |         - ^ second mutable borrow occurs here
25    |         |
26    |         first mutable borrow occurs here
27    |         first borrow later used by call
28
29 error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined
30   --> $DIR/two-phase-nonrecv-autoref.rs:85:9
31    |
32 LL |         f(f(10));
33    |         ^
34
35 error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined
36   --> $DIR/two-phase-nonrecv-autoref.rs:85:11
37    |
38 LL |         f(f(10));
39    |           ^
40
41 error[E0382]: use of moved value: `*f`
42   --> $DIR/two-phase-nonrecv-autoref.rs:85:11
43    |
44 LL |         f(f(10));
45    |         - ^ value used here after move
46    |         |
47    |         value moved here
48    |
49    = note: move occurs because `*f` has type `dyn std::ops::FnOnce(i32) -> i32`, which does not implement the `Copy` trait
50
51 error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
52   --> $DIR/two-phase-nonrecv-autoref.rs:129:27
53    |
54 LL |     double_access(&mut a, &a);
55    |     ------------- ------  ^^ immutable borrow occurs here
56    |     |             |
57    |     |             mutable borrow occurs here
58    |     mutable borrow later used by call
59
60 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
61   --> $DIR/two-phase-nonrecv-autoref.rs:157:7
62    |
63 LL |     i[i[3]] = 4;
64    |     --^----
65    |     | |
66    |     | immutable borrow occurs here
67    |     mutable borrow occurs here
68    |     mutable borrow later used here
69
70 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
71   --> $DIR/two-phase-nonrecv-autoref.rs:163:7
72    |
73 LL |     i[i[3]] = i[4];
74    |     --^----
75    |     | |
76    |     | immutable borrow occurs here
77    |     mutable borrow occurs here
78    |     mutable borrow later used here
79
80 error: aborting due to 9 previous errors
81
82 Some errors occurred: E0161, E0382, E0499, E0502.
83 For more information about an error, try `rustc --explain E0161`.