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