]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/two-phase-surprise-no-conflict.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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    |     ----------------------------------------------^^^^^^^^^^^^^^^^^---
27    |     |   |                                         |
28    |     |   |                                         second mutable borrow occurs here
29    |     |   first borrow later used by call
30    |     first mutable borrow occurs here
31
32 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
33   --> $DIR/two-phase-surprise-no-conflict.rs:122:54
34    |
35 LL |     reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
36    |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
37    |     |   |                                            |
38    |     |   |                                            second mutable borrow occurs here
39    |     |   first borrow later used by call
40    |     first mutable borrow occurs here
41
42 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
43   --> $DIR/two-phase-surprise-no-conflict.rs:125:53
44    |
45 LL |     reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
46    |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
47    |     |   |                                           |
48    |     |   |                                           second mutable borrow occurs here
49    |     |   first borrow later used by call
50    |     first mutable borrow occurs here
51
52 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
53   --> $DIR/two-phase-surprise-no-conflict.rs:128:44
54    |
55 LL |     reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
56    |     ---------------------------------------^^^^^^^^^^^^^^^^^--
57    |     |   |                                  |
58    |     |   |                                  second mutable borrow occurs here
59    |     |   first borrow later used by call
60    |     first mutable borrow occurs here
61
62 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
63   --> $DIR/two-phase-surprise-no-conflict.rs:138:5
64    |
65 LL |     reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
66    |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
67    |     |   |                                        |
68    |     |   |                                        immutable borrow occurs here
69    |     |   immutable borrow later used by call
70    |     mutable borrow occurs here
71
72 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
73   --> $DIR/two-phase-surprise-no-conflict.rs:141:5
74    |
75 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
76    |                     -- lifetime `'a` defined here
77 ...
78 LL |     reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
79    |     ^^^^^^^^^^^^^^^^^^-----------------------------------------^
80    |     |                 |                         |
81    |     |                 |                         immutable borrow occurs here
82    |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
83    |     mutable borrow occurs here
84
85 error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
86   --> $DIR/two-phase-surprise-no-conflict.rs:144:5
87    |
88 LL |     reg.register_ref(&CapturePass::new(&reg.sess_mut));
89    |     ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
90    |     |   |                              |
91    |     |   |                              immutable borrow occurs here
92    |     |   immutable borrow later used by call
93    |     mutable borrow occurs here
94
95 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
96   --> $DIR/two-phase-surprise-no-conflict.rs:154:5
97    |
98 LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
99    |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
100    |     |   |                                            |
101    |     |   |                                            first mutable borrow occurs here
102    |     |   first borrow later used by call
103    |     second mutable borrow occurs here
104
105 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
106   --> $DIR/two-phase-surprise-no-conflict.rs:154:54
107    |
108 LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
109    |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
110    |     |   |                                            |
111    |     |   |                                            second mutable borrow occurs here
112    |     |   first borrow later used by call
113    |     first mutable borrow occurs here
114
115 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
116   --> $DIR/two-phase-surprise-no-conflict.rs:158:5
117    |
118 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
119    |                     -- lifetime `'a` defined here
120 ...
121 LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
122    |     ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
123    |     |                 |                             |
124    |     |                 |                             first mutable borrow occurs here
125    |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
126    |     second mutable borrow occurs here
127
128 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
129   --> $DIR/two-phase-surprise-no-conflict.rs:158:53
130    |
131 LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
132    |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
133    |     |   |                                           |
134    |     |   |                                           second mutable borrow occurs here
135    |     |   first borrow later used by call
136    |     first mutable borrow occurs here
137
138 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
139   --> $DIR/two-phase-surprise-no-conflict.rs:162:5
140    |
141 LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
142    |     ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
143    |     |   |                                  |
144    |     |   |                                  first mutable borrow occurs here
145    |     |   first borrow later used by call
146    |     second mutable borrow occurs here
147
148 error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
149   --> $DIR/two-phase-surprise-no-conflict.rs:162:44
150    |
151 LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
152    |     ---------------------------------------^^^^^^^^^^^^^^^^^--
153    |     |   |                                  |
154    |     |   |                                  second mutable borrow occurs here
155    |     |   first borrow later used by call
156    |     first mutable borrow occurs here
157
158 error: aborting due to 15 previous errors
159
160 Some errors have detailed explanations: E0499, E0502, E0503.
161 For more information about an error, try `rustc --explain E0499`.