]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
Auto merge of #87284 - Aaron1011:remove-paren-special, r=petrochenkov
[rust.git] / src / test / ui / borrowck / two-phase-surprise-no-conflict.stderr
1 error[E0503]: cannot use `self.cx` because it was mutably borrowed
2   --> $DIR/two-phase-surprise-no-conflict.rs:21:23
3    |
4 LL |         let _mut_borrow = &mut *self;
5    |                           ---------- borrow of `*self` occurs here
6 LL |         let _access = self.cx;
7    |                       ^^^^^^^ use of borrowed `*self`
8 LL |
9 LL |         _mut_borrow;
10    |         ----------- borrow later used here
11
12 error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
13   --> $DIR/two-phase-surprise-no-conflict.rs:57:17
14    |
15 LL |                 self.hash_expr(&self.cx_mut.body(eid).value);
16    |                 ^^^^^---------^^-----------^^^^^^^^^^^^^^^^^
17    |                 |    |          |
18    |                 |    |          immutable borrow occurs here
19    |                 |    immutable borrow later used by call
20    |                 mutable borrow occurs here
21
22 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
23   --> $DIR/two-phase-surprise-no-conflict.rs:119:51
24    |
25 LL |     reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
26    |     --- ---------------                           ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
27    |     |   |
28    |     |   first borrow later used by call
29    |     first mutable borrow occurs here
30
31 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
32   --> $DIR/two-phase-surprise-no-conflict.rs:122:54
33    |
34 LL |     reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
35    |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
36    |     |   |
37    |     |   first borrow later used by call
38    |     first mutable borrow occurs here
39
40 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
41   --> $DIR/two-phase-surprise-no-conflict.rs:125:53
42    |
43 LL |     reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
44    |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
45    |     |   |
46    |     |   first borrow later used by call
47    |     first mutable borrow occurs here
48
49 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
50   --> $DIR/two-phase-surprise-no-conflict.rs:128:44
51    |
52 LL |     reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
53    |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
54    |     |   |
55    |     |   first borrow later used by call
56    |     first mutable borrow occurs here
57
58 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
59   --> $DIR/two-phase-surprise-no-conflict.rs:138:5
60    |
61 LL |     reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
62    |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
63    |     |   |                                        |
64    |     |   |                                        immutable borrow occurs here
65    |     |   immutable borrow later used by call
66    |     mutable borrow occurs here
67
68 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
69   --> $DIR/two-phase-surprise-no-conflict.rs:141:5
70    |
71 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
72    |                     -- lifetime `'a` defined here
73 ...
74 LL |     reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
75    |     ^^^^^^^^^^^^^^^^^^-----------------------------------------^
76    |     |                 |                         |
77    |     |                 |                         immutable borrow occurs here
78    |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
79    |     mutable borrow occurs here
80
81 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
82   --> $DIR/two-phase-surprise-no-conflict.rs:144:5
83    |
84 LL |     reg.register_ref(&CapturePass::new(&reg.sess_mut));
85    |     ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
86    |     |   |                              |
87    |     |   |                              immutable borrow occurs here
88    |     |   immutable borrow later used by call
89    |     mutable borrow occurs here
90
91 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
92   --> $DIR/two-phase-surprise-no-conflict.rs:154:5
93    |
94 LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
95    |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
96    |     |   |                                            |
97    |     |   |                                            first mutable borrow occurs here
98    |     |   first borrow later used by call
99    |     second mutable borrow occurs here
100
101 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
102   --> $DIR/two-phase-surprise-no-conflict.rs:154:54
103    |
104 LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
105    |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
106    |     |   |
107    |     |   first borrow later used by call
108    |     first mutable borrow occurs here
109
110 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
111   --> $DIR/two-phase-surprise-no-conflict.rs:158:5
112    |
113 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
114    |                     -- lifetime `'a` defined here
115 ...
116 LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
117    |     ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
118    |     |                 |                             |
119    |     |                 |                             first mutable borrow occurs here
120    |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
121    |     second mutable borrow occurs here
122
123 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
124   --> $DIR/two-phase-surprise-no-conflict.rs:158:53
125    |
126 LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
127    |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
128    |     |   |
129    |     |   first borrow later used by call
130    |     first mutable borrow occurs here
131
132 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
133   --> $DIR/two-phase-surprise-no-conflict.rs:162:5
134    |
135 LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
136    |     ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
137    |     |   |                                  |
138    |     |   |                                  first mutable borrow occurs here
139    |     |   first borrow later used by call
140    |     second mutable borrow occurs here
141
142 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
143   --> $DIR/two-phase-surprise-no-conflict.rs:162:44
144    |
145 LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
146    |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
147    |     |   |
148    |     |   first borrow later used by call
149    |     first mutable borrow occurs here
150
151 error: aborting due to 15 previous errors
152
153 Some errors have detailed explanations: E0499, E0502, E0503.
154 For more information about an error, try `rustc --explain E0499`.