2018-08-01 14:40:06 -05:00
|
|
|
error[E0506]: cannot assign to `x` because it is borrowed
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/closure-use-spans.rs:5:5
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
|
LL | let y = &x;
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `x` is borrowed here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | x = 0;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^ `x` is assigned to here but it was already borrowed
|
2018-08-01 14:40:06 -05:00
|
|
|
LL | || *y;
|
2021-03-17 01:51:27 -05:00
|
|
|
| -- borrow later captured here by closure
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
error[E0506]: cannot assign to `x` because it is borrowed
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/closure-use-spans.rs:11:5
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
|
LL | let y = &mut x;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ------ `x` is borrowed here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | x = 0;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^ `x` is assigned to here but it was already borrowed
|
2018-08-01 14:40:06 -05:00
|
|
|
LL | || *y = 1;
|
2021-03-17 01:51:27 -05:00
|
|
|
| -- borrow later captured here by closure
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
error[E0506]: cannot assign to `x` because it is borrowed
|
2019-04-07 10:07:36 -05:00
|
|
|
--> $DIR/closure-use-spans.rs:17:5
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
|
LL | let y = &x;
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `x` is borrowed here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | x = 0;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^ `x` is assigned to here but it was already borrowed
|
2018-08-01 14:40:06 -05:00
|
|
|
LL | move || *y;
|
2021-08-29 15:28:58 -05:00
|
|
|
| -- borrow later captured here by closure
|
2018-08-01 14:40:06 -05:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0506`.
|