|
| 1 | +error[E0503]: cannot use `self.cx` because it was mutably borrowed |
| 2 | + --> $DIR/two-phase-surprise-no-conflict.rs:40: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 | +... |
| 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:79:17 |
| 14 | + | |
| 15 | +LL | self.hash_expr(&self.cx_mut.body(eid).value); |
| 16 | + | ^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^^^^^ |
| 17 | + | | | |
| 18 | + | | immutable borrow occurs here |
| 19 | + | mutable borrow occurs here |
| 20 | + | borrow later used 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:151: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 mutable borrow occurs here |
| 30 | + | borrow later used 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:156: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 mutable borrow occurs here |
| 40 | + | borrow later used 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:161: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 mutable borrow occurs here |
| 50 | + | borrow later used 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:166:44 |
| 54 | + | |
| 55 | +LL | reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut)); |
| 56 | + | ---------------------------------------^^^^^^^^^^^^^^^^^-- |
| 57 | + | | | |
| 58 | + | | second mutable borrow occurs here |
| 59 | + | first mutable borrow occurs here |
| 60 | + | borrow later used 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:178:5 |
| 64 | + | |
| 65 | +LL | reg.register_bound(Box::new(CapturePass::new(®.sess_mut))); |
| 66 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^ |
| 67 | + | | | |
| 68 | + | | immutable borrow occurs here |
| 69 | + | mutable borrow occurs here |
| 70 | + | borrow later used 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:183:5 |
| 74 | + | |
| 75 | +LL | reg.register_univ(Box::new(CapturePass::new(®.sess_mut))); |
| 76 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^ |
| 77 | + | | | |
| 78 | + | | immutable borrow occurs here |
| 79 | + | mutable borrow occurs here |
| 80 | + | |
| 81 | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 122:21... |
| 82 | + --> $DIR/two-phase-surprise-no-conflict.rs:122:21 |
| 83 | + | |
| 84 | +LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) { |
| 85 | + | ^^ |
| 86 | + |
| 87 | +error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable |
| 88 | + --> $DIR/two-phase-surprise-no-conflict.rs:188:5 |
| 89 | + | |
| 90 | +LL | reg.register_ref(&CapturePass::new(®.sess_mut)); |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^ |
| 92 | + | | | |
| 93 | + | | immutable borrow occurs here |
| 94 | + | mutable borrow occurs here |
| 95 | + | borrow later used here |
| 96 | + |
| 97 | +error[E0499]: cannot borrow `*reg` as mutable more than once at a time |
| 98 | + --> $DIR/two-phase-surprise-no-conflict.rs:200:5 |
| 99 | + | |
| 100 | +LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut))); |
| 101 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^ |
| 102 | + | | | |
| 103 | + | | first mutable borrow occurs here |
| 104 | + | second mutable borrow occurs here |
| 105 | + | borrow later used here |
| 106 | + |
| 107 | +error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time |
| 108 | + --> $DIR/two-phase-surprise-no-conflict.rs:200:54 |
| 109 | + | |
| 110 | +LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut))); |
| 111 | + | -------------------------------------------------^^^^^^^^^^^^^^^^^--- |
| 112 | + | | | |
| 113 | + | | second mutable borrow occurs here |
| 114 | + | first mutable borrow occurs here |
| 115 | + | borrow later used here |
| 116 | + |
| 117 | +error[E0499]: cannot borrow `*reg` as mutable more than once at a time |
| 118 | + --> $DIR/two-phase-surprise-no-conflict.rs:206:5 |
| 119 | + | |
| 120 | +LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut))); |
| 121 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^ |
| 122 | + | | | |
| 123 | + | | first mutable borrow occurs here |
| 124 | + | second mutable borrow occurs here |
| 125 | + | |
| 126 | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 122:21... |
| 127 | + --> $DIR/two-phase-surprise-no-conflict.rs:122:21 |
| 128 | + | |
| 129 | +LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) { |
| 130 | + | ^^ |
| 131 | + |
| 132 | +error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time |
| 133 | + --> $DIR/two-phase-surprise-no-conflict.rs:206:53 |
| 134 | + | |
| 135 | +LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut))); |
| 136 | + | ------------------------------------------------^^^^^^^^^^^^^^^^^--- |
| 137 | + | | | |
| 138 | + | | second mutable borrow occurs here |
| 139 | + | first mutable borrow occurs here |
| 140 | + | borrow later used here |
| 141 | + |
| 142 | +error[E0499]: cannot borrow `*reg` as mutable more than once at a time |
| 143 | + --> $DIR/two-phase-surprise-no-conflict.rs:212:5 |
| 144 | + | |
| 145 | +LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut)); |
| 146 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^ |
| 147 | + | | | |
| 148 | + | | first mutable borrow occurs here |
| 149 | + | second mutable borrow occurs here |
| 150 | + | borrow later used here |
| 151 | + |
| 152 | +error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time |
| 153 | + --> $DIR/two-phase-surprise-no-conflict.rs:212:44 |
| 154 | + | |
| 155 | +LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut)); |
| 156 | + | ---------------------------------------^^^^^^^^^^^^^^^^^-- |
| 157 | + | | | |
| 158 | + | | second mutable borrow occurs here |
| 159 | + | first mutable borrow occurs here |
| 160 | + | borrow later used here |
| 161 | + |
| 162 | +error: aborting due to 15 previous errors |
| 163 | + |
| 164 | +Some errors occurred: E0499, E0502, E0503. |
| 165 | +For more information about an error, try `rustc --explain E0499`. |
0 commit comments