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