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