]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/two-phase-nonrecv-autoref.ast.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / borrowck / two-phase-nonrecv-autoref.ast.stderr
1 error[E0503]: cannot use `*x` because it was mutably borrowed
2   --> $DIR/two-phase-nonrecv-autoref.rs:41:12
3    |
4 LL |     foo(x, *x);
5    |         -  ^^ use of borrowed `*x`
6    |         |
7    |         borrow of `*x` occurs here
8
9 error[E0499]: cannot borrow `*f` as mutable more than once at a time
10   --> $DIR/two-phase-nonrecv-autoref.rs:70:11
11    |
12 LL |         f(f(10));
13    |         - ^    - first borrow ends here
14    |         | |
15    |         | second mutable borrow occurs here
16    |         first mutable borrow occurs here
17
18 error[E0382]: use of moved value: `*f`
19   --> $DIR/two-phase-nonrecv-autoref.rs:79:11
20    |
21 LL |         f(f(10));
22    |         - ^ value used here after move
23    |         |
24    |         value moved here
25    |
26    = note: move occurs because `*f` has type `F`, which does not implement the `Copy` trait
27
28 error[E0499]: cannot borrow `*f` as mutable more than once at a time
29   --> $DIR/two-phase-nonrecv-autoref.rs:86:11
30    |
31 LL |         f(f(10));
32    |         - ^    - first borrow ends here
33    |         | |
34    |         | second mutable borrow occurs here
35    |         first mutable borrow occurs here
36
37 error[E0382]: use of moved value: `*f`
38   --> $DIR/two-phase-nonrecv-autoref.rs:95:11
39    |
40 LL |         f(f(10));
41    |         - ^ value used here after move
42    |         |
43    |         value moved here
44    |
45    = note: move occurs because `*f` has type `(dyn std::ops::FnOnce(i32) -> i32 + 'static)`, which does not implement the `Copy` trait
46
47 error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
48   --> $DIR/two-phase-nonrecv-autoref.rs:139:28
49    |
50 LL |     double_access(&mut a, &a);
51    |                        -   ^- mutable borrow ends here
52    |                        |   |
53    |                        |   immutable borrow occurs here
54    |                        mutable borrow occurs here
55
56 error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
57   --> $DIR/two-phase-nonrecv-autoref.rs:145:9
58    |
59 LL |     a.m(a.i(10));
60    |     -   ^      - mutable borrow ends here
61    |     |   |
62    |     |   immutable borrow occurs here
63    |     mutable borrow occurs here
64
65 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
66   --> $DIR/two-phase-nonrecv-autoref.rs:167:7
67    |
68 LL |     i[i[3]] = 4;
69    |     - ^   - mutable borrow ends here
70    |     | |
71    |     | immutable borrow occurs here
72    |     mutable borrow occurs here
73
74 error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
75   --> $DIR/two-phase-nonrecv-autoref.rs:173:7
76    |
77 LL |     i[i[3]] = i[4];
78    |     - ^   - mutable borrow ends here
79    |     | |
80    |     | immutable borrow occurs here
81    |     mutable borrow occurs here
82
83 error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable
84   --> $DIR/two-phase-nonrecv-autoref.rs:182:12
85    |
86 LL |     v.push(v.len());
87    |     -      ^      - mutable borrow ends here
88    |     |      |
89    |     |      immutable borrow occurs here
90    |     mutable borrow occurs here
91
92 error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable
93   --> $DIR/two-phase-nonrecv-autoref.rs:193:9
94    |
95 LL |     s.m(s.i(10));
96    |     -   ^      - mutable borrow ends here
97    |     |   |
98    |     |   immutable borrow occurs here
99    |     mutable borrow occurs here
100
101 error[E0502]: cannot borrow `t` as immutable because it is also borrowed as mutable
102   --> $DIR/two-phase-nonrecv-autoref.rs:198:9
103    |
104 LL |     t.m(t.i(10));
105    |     -   ^      - mutable borrow ends here
106    |     |   |
107    |     |   immutable borrow occurs here
108    |     mutable borrow occurs here
109
110 error: aborting due to 12 previous errors
111
112 Some errors occurred: E0382, E0499, E0502, E0503.
113 For more information about an error, try `rustc --explain E0382`.