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