2020-12-13 00:29:20 -06:00
|
|
|
error[E0596]: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/mut_ref.rs:12:13
|
2020-12-13 00:29:20 -06:00
|
|
|
|
|
|
|
|
LL | let c = || {
|
|
|
|
| ^^ `ref_mref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
|
|
|
LL |
|
|
|
|
LL | **ref_mref_x = y;
|
2021-03-17 01:51:27 -05:00
|
|
|
| ------------ mutable borrow occurs due to use of `**ref_mref_x` in closure
|
2022-12-28 23:52:57 -06:00
|
|
|
|
|
|
|
|
help: consider changing this to be a mutable reference
|
|
|
|
|
|
|
|
|
LL | let ref_mref_x = &mut mref_x;
|
2023-04-19 01:22:03 -05:00
|
|
|
| +++
|
2020-12-13 00:29:20 -06:00
|
|
|
|
|
|
|
error[E0596]: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/mut_ref.rs:26:13
|
2020-12-13 00:29:20 -06:00
|
|
|
|
|
|
|
|
LL | let c = || {
|
|
|
|
| ^^ cannot borrow as mutable
|
|
|
|
LL |
|
|
|
|
LL | **mref_ref_x = y;
|
2021-03-17 01:51:27 -05:00
|
|
|
| ------------ mutable borrow occurs due to use of `**mref_ref_x` in closure
|
2020-12-13 00:29:20 -06:00
|
|
|
|
2021-06-27 01:22:46 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2020-12-13 00:29:20 -06:00
|
|
|
|
2020-12-12 23:11:15 -06:00
|
|
|
For more information about this error, try `rustc --explain E0596`.
|