1 error[E0503]: cannot use `self.cx` because it was mutably borrowed
2 --> $DIR/two-phase-surprise-no-conflict.rs:21:23
4 LL | let _mut_borrow = &mut *self;
5 | ---------- borrow of `*self` occurs here
6 LL | let _access = self.cx;
7 | ^^^^^^^ use of borrowed `*self`
10 | ----------- borrow later used here
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
15 LL | self.hash_expr(&self.cx_mut.body(eid).value);
16 | ^^^^^---------^^---------------------^^^^^^^
18 | | | immutable borrow occurs here
19 | | immutable borrow later used by call
20 | mutable borrow occurs here
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
25 LL | reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
26 | ----------------------------------------------^^^^^^^^^^^^^^^^^---
28 | | | second mutable borrow occurs here
29 | | first borrow later used by call
30 | first mutable borrow occurs here
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
35 LL | reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
36 | -------------------------------------------------^^^^^^^^^^^^^^^^^---
38 | | | second mutable borrow occurs here
39 | | first borrow later used by call
40 | first mutable borrow occurs here
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
45 LL | reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
46 | ------------------------------------------------^^^^^^^^^^^^^^^^^---
48 | | | second mutable borrow occurs here
49 | | first borrow later used by call
50 | first mutable borrow occurs here
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
55 LL | reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
56 | ---------------------------------------^^^^^^^^^^^^^^^^^--
58 | | | second mutable borrow occurs here
59 | | first borrow later used by call
60 | first mutable borrow occurs here
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
65 LL | reg.register_bound(Box::new(CapturePass::new(®.sess_mut)));
66 | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
68 | | | immutable borrow occurs here
69 | | immutable borrow later used by call
70 | mutable borrow occurs here
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
75 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
76 | -- lifetime `'a` defined here
78 LL | reg.register_univ(Box::new(CapturePass::new(®.sess_mut)));
79 | ^^^^^^^^^^^^^^^^^^-----------------------------------------^
81 | | | immutable borrow occurs here
82 | | cast requires that `reg.sess_mut` is borrowed for `'a`
83 | mutable borrow occurs here
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
88 LL | reg.register_ref(&CapturePass::new(®.sess_mut));
89 | ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
91 | | | immutable borrow occurs here
92 | | immutable borrow later used by call
93 | mutable borrow occurs here
95 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
96 --> $DIR/two-phase-surprise-no-conflict.rs:154:5
98 LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
99 | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
101 | | | first mutable borrow occurs here
102 | | first borrow later used by call
103 | second mutable borrow occurs here
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
108 LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
109 | -------------------------------------------------^^^^^^^^^^^^^^^^^---
111 | | | second mutable borrow occurs here
112 | | first borrow later used by call
113 | first mutable borrow occurs here
115 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
116 --> $DIR/two-phase-surprise-no-conflict.rs:158:5
118 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
119 | -- lifetime `'a` defined here
121 LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
122 | ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
124 | | | first mutable borrow occurs here
125 | | cast requires that `reg.sess_mut` is borrowed for `'a`
126 | second mutable borrow occurs here
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
131 LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
132 | ------------------------------------------------^^^^^^^^^^^^^^^^^---
134 | | | second mutable borrow occurs here
135 | | first borrow later used by call
136 | first mutable borrow occurs here
138 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
139 --> $DIR/two-phase-surprise-no-conflict.rs:162:5
141 LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
142 | ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
144 | | | first mutable borrow occurs here
145 | | first borrow later used by call
146 | second mutable borrow occurs here
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
151 LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
152 | ---------------------------------------^^^^^^^^^^^^^^^^^--
154 | | | second mutable borrow occurs here
155 | | first borrow later used by call
156 | first mutable borrow occurs here
158 error: aborting due to 15 previous errors
160 Some errors have detailed explanations: E0499, E0502, E0503.
161 For more information about an error, try `rustc --explain E0499`.