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 | --- --------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
28 | | first borrow later used by call
29 | first mutable borrow occurs here
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
34 LL | reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
35 | --- -------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
37 | | first borrow later used by call
38 | first mutable borrow occurs here
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
43 LL | reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
44 | --- ------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
46 | | first borrow later used by call
47 | first mutable borrow occurs here
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
52 LL | reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
53 | --- ------------ ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
55 | | first borrow later used by call
56 | first mutable borrow occurs here
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
61 LL | reg.register_bound(Box::new(CapturePass::new(®.sess_mut)));
62 | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
64 | | | immutable borrow occurs here
65 | | immutable borrow later used by call
66 | mutable borrow occurs here
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
71 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
72 | -- lifetime `'a` defined here
74 LL | reg.register_univ(Box::new(CapturePass::new(®.sess_mut)));
75 | ^^^^^^^^^^^^^^^^^^-----------------------------------------^
77 | | | immutable borrow occurs here
78 | | cast requires that `reg.sess_mut` is borrowed for `'a`
79 | mutable borrow occurs here
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
84 LL | reg.register_ref(&CapturePass::new(®.sess_mut));
85 | ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
87 | | | immutable borrow occurs here
88 | | immutable borrow later used by call
89 | mutable borrow occurs here
91 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
92 --> $DIR/two-phase-surprise-no-conflict.rs:154:5
94 LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
95 | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
97 | | | first mutable borrow occurs here
98 | | first borrow later used by call
99 | second mutable borrow occurs here
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
104 LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
105 | --- -------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
107 | | first borrow later used by call
108 | first mutable borrow occurs here
110 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
111 --> $DIR/two-phase-surprise-no-conflict.rs:158:5
113 LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
114 | -- lifetime `'a` defined here
116 LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
117 | ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
119 | | | first mutable borrow occurs here
120 | | cast requires that `reg.sess_mut` is borrowed for `'a`
121 | second mutable borrow occurs here
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
126 LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
127 | --- ------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
129 | | first borrow later used by call
130 | first mutable borrow occurs here
132 error[E0499]: cannot borrow `*reg` as mutable more than once at a time
133 --> $DIR/two-phase-surprise-no-conflict.rs:162:5
135 LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
136 | ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
138 | | | first mutable borrow occurs here
139 | | first borrow later used by call
140 | second mutable borrow occurs here
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
145 LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
146 | --- ------------ ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
148 | | first borrow later used by call
149 | first mutable borrow occurs here
151 error: aborting due to 15 previous errors
153 Some errors have detailed explanations: E0499, E0502, E0503.
154 For more information about an error, try `rustc --explain E0499`.