rust/tests/ui/nll/closure-use-spans.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1.1 KiB
Plaintext
Raw Normal View History

2018-08-01 20:40:06 +01:00
error[E0506]: cannot assign to `x` because it is borrowed
--> $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;
| -- borrow later captured here by closure
2018-08-01 20:40:06 +01:00
error[E0506]: cannot assign to `x` because it is borrowed
--> $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;
| -- borrow later captured here by closure
2018-08-01 20:40:06 +01:00
error[E0506]: cannot assign to `x` because it is borrowed
--> $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`.