rust/tests/ui/borrowck/borrowck-vec-pattern-move-tail.stderr

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

15 lines
511 B
Plaintext
Raw Normal View History

2018-12-27 05:08:51 -06:00
error[E0506]: cannot assign to `a[_]` because it is borrowed
2019-12-29 18:23:42 -06:00
--> $DIR/borrowck-vec-pattern-move-tail.rs:8:5
2018-08-08 07:28:26 -05:00
|
LL | [1, 2, ref tail @ ..] => tail,
2023-01-14 21:06:44 -06:00
| -------- `a[_]` is borrowed here
2018-08-08 07:28:26 -05:00
...
LL | a[2] = 0;
2023-01-14 21:06:44 -06:00
| ^^^^^^^^ `a[_]` is assigned to here but it was already borrowed
2018-08-08 07:28:26 -05:00
LL | println!("t[0]: {}", t[0]);
| ---- borrow later used here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0506`.