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