2018-06-20 01:31:33 -03:00
|
|
|
error[E0502]: cannot borrow `self.thing` as mutable because it is also borrowed as immutable
|
2021-04-03 13:05:11 +02:00
|
|
|
--> $DIR/issue-51268.rs:14:9
|
2018-06-20 01:31:33 -03:00
|
|
|
|
|
2018-09-29 11:47:47 +01:00
|
|
|
LL | self.thing.bar(|| {
|
|
|
|
| ^ --- -- immutable borrow occurs here
|
|
|
|
| | |
|
|
|
|
| _________| immutable borrow later used by call
|
|
|
|
| |
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | |
|
2018-09-29 11:47:47 +01:00
|
|
|
LL | | &self.number;
|
2021-03-17 02:51:27 -04:00
|
|
|
| | ----------- first borrow occurs due to use of `self` in closure
|
2018-09-29 11:47:47 +01:00
|
|
|
LL | | });
|
|
|
|
| |__________^ mutable borrow occurs here
|
2018-06-20 01:31:33 -03:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0502`.
|