rust/src/test/ui/nll/closure-use-spans.stderr

34 lines
1.0 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;
| -- borrow of `x` occurs here
2019-03-09 06:03:44 -06:00
LL | x = 0;
2018-08-01 14:40:06 -05:00
| ^^^^^ assignment to borrowed `x` occurs here
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;
| ------ borrow of `x` occurs here
2019-03-09 06:03:44 -06:00
LL | x = 0;
2018-08-01 14:40:06 -05:00
| ^^^^^ assignment to borrowed `x` occurs here
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;
| -- borrow of `x` occurs here
2019-03-09 06:03:44 -06:00
LL | x = 0;
2018-08-01 14:40:06 -05:00
| ^^^^^ assignment to borrowed `x` occurs here
LL | move || *y;
| - borrow later captured here by closure
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0506`.