rust/src/test/ui/borrowck/two-phase-surprise-no-conflict.nll.stderr

155 lines
7.2 KiB
Plaintext
Raw Normal View History

error[E0503]: cannot use `self.cx` because it was mutably borrowed
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:30:23
|
LL | let _mut_borrow = &mut *self;
| ---------- borrow of `*self` occurs here
LL | let _access = self.cx;
| ^^^^^^^ use of borrowed `*self`
...
LL | _mut_borrow;
| ----------- borrow later used here
error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:69:17
|
LL | self.hash_expr(&self.cx_mut.body(eid).value);
| ^^^^^---------^^-----------^^^^^^^^^^^^^^^^^
| | | |
| | | immutable borrow occurs here
| | immutable borrow later used by call
| mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:141:51
|
LL | reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
| --- --------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:146:54
|
LL | reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
| --- -------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:151:53
|
LL | reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
| --- ------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:156:44
|
LL | reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
| --- ------------ ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:168:5
|
LL | reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
| ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
| | | |
| | | immutable borrow occurs here
| | immutable borrow later used by call
| mutable borrow occurs here
error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:173:5
|
LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
| -- lifetime `'a` defined here
...
LL | reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
| ^^^^^^^^^^^^^^^^^^-----------------------------------------^
| | | |
| | | immutable borrow occurs here
| | cast requires that `reg.sess_mut` is borrowed for `'a`
| mutable borrow occurs here
error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:178:5
|
LL | reg.register_ref(&CapturePass::new(&reg.sess_mut));
| ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
| | | |
| | | immutable borrow occurs here
| | immutable borrow later used by call
| mutable borrow occurs here
error[E0499]: cannot borrow `*reg` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:190:5
|
LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
| ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
| | | |
| | | first mutable borrow occurs here
| | first borrow later used by call
| second mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:190:54
|
LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
| --- -------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0499]: cannot borrow `*reg` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:196:5
|
LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
| -- lifetime `'a` defined here
...
LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
| ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
| | | |
| | | first mutable borrow occurs here
| | cast requires that `reg.sess_mut` is borrowed for `'a`
| second mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:196:53
|
LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
| --- ------------- ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error[E0499]: cannot borrow `*reg` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:202:5
|
LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
| ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
| | | |
| | | first mutable borrow occurs here
| | first borrow later used by call
| second mutable borrow occurs here
error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
2018-12-25 09:56:47 -06:00
--> $DIR/two-phase-surprise-no-conflict.rs:202:44
|
LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
| --- ------------ ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
| | |
| | first borrow later used by call
| first mutable borrow occurs here
error: aborting due to 15 previous errors
Some errors occurred: E0499, E0502, E0503.
For more information about an error, try `rustc --explain E0499`.