summary refs log tree commit diff
path: root/src/test/ui/borrowck/two-phase-nonrecv-autoref.ast.stderr
blob: d98b272944fdc0ff64e1138d3f0ae83f2983f4cf (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
error[E0503]: cannot use `*x` because it was mutably borrowed
  --> $DIR/two-phase-nonrecv-autoref.rs:31:12
   |
LL |     foo(x, *x);
   |         -  ^^ use of borrowed `*x`
   |         |
   |         borrow of `*x` occurs here

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

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

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

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

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

error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:131:9
   |
LL |     a.m(a.i(10));
   |     -   ^      - mutable borrow ends here
   |     |   |
   |     |   immutable borrow occurs here
   |     mutable borrow occurs here

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

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

error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:168:12
   |
LL |     v.push(v.len());
   |     -      ^      - mutable borrow ends here
   |     |      |
   |     |      immutable borrow occurs here
   |     mutable borrow occurs here

error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:179:9
   |
LL |     s.m(s.i(10));
   |     -   ^      - mutable borrow ends here
   |     |   |
   |     |   immutable borrow occurs here
   |     mutable borrow occurs here

error[E0502]: cannot borrow `t` as immutable because it is also borrowed as mutable
  --> $DIR/two-phase-nonrecv-autoref.rs:184:9
   |
LL |     t.m(t.i(10));
   |     -   ^      - mutable borrow ends here
   |     |   |
   |     |   immutable borrow occurs here
   |     mutable borrow occurs here

error: aborting due to 12 previous errors

Some errors occurred: E0382, E0499, E0502, E0503.
For more information about an error, try `rustc --explain E0382`.