rust/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr

16 lines
568 B
Plaintext
Raw Normal View History

2018-12-27 05:08:51 -06:00
error[E0506]: cannot assign to `a[_]` because it is borrowed
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-vec-pattern-move-tail.rs:16:5
2018-08-08 07:28:26 -05:00
|
LL | [1, 2, ref tail..] => tail,
2018-12-27 05:08:51 -06:00
| -------- borrow of `a[_]` occurs here
2018-08-08 07:28:26 -05:00
...
LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed
2018-12-27 05:08:51 -06:00
| ^^^^^^^^ assignment to borrowed `a[_]` occurs here
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`.