]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Auto merge of #59700 - matklad:simplify, r=eddyb
[rust.git] / src / test / ui / borrowck / borrowck-vec-pattern-nesting.stderr
1 error[E0506]: cannot assign to `vec[..]` because it is borrowed
2   --> $DIR/borrowck-vec-pattern-nesting.rs:10:13
3    |
4 LL |         [box ref _a, _, _] => {
5    |              ------ borrow of `vec[..]` occurs here
6 LL |
7 LL |             vec[0] = box 4;
8    |             ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
9
10 error[E0506]: cannot assign to `vec[..]` because it is borrowed
11   --> $DIR/borrowck-vec-pattern-nesting.rs:23:13
12    |
13 LL |         &mut [ref _b..] => {
14    |               ------ borrow of `vec[..]` occurs here
15 LL |
16 LL |             vec[0] = box 4;
17    |             ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
18
19 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
20   --> $DIR/borrowck-vec-pattern-nesting.rs:34:14
21    |
22 LL |           &mut [_a,
23    |                ^-- hint: to prevent move, use `ref _a` or `ref mut _a`
24    |  ______________|
25    | |
26 LL | |
27 LL | |
28 LL | |             ..
29 LL | |         ] => {
30    | |_________^ cannot move out of here
31
32 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
33   --> $DIR/borrowck-vec-pattern-nesting.rs:47:13
34    |
35 LL |     let a = vec[0];
36    |             ^^^^^^
37    |             |
38    |             cannot move out of here
39    |             help: consider using a reference instead: `&vec[0]`
40
41 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
42   --> $DIR/borrowck-vec-pattern-nesting.rs:55:14
43    |
44 LL |           &mut [
45    |  ______________^
46 LL | |
47 LL | |          _b] => {}
48    | |__________--^ cannot move out of here
49    |            |
50    |            hint: to prevent move, use `ref _b` or `ref mut _b`
51
52 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
53   --> $DIR/borrowck-vec-pattern-nesting.rs:60:13
54    |
55 LL |     let a = vec[0];
56    |             ^^^^^^
57    |             |
58    |             cannot move out of here
59    |             help: consider using a reference instead: `&vec[0]`
60
61 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
62   --> $DIR/borrowck-vec-pattern-nesting.rs:68:14
63    |
64 LL |         &mut [_a, _b, _c] => {}
65    |              ^--^^--^^--^
66    |              ||   |   |
67    |              ||   |   ...and here (use `ref _c` or `ref mut _c`)
68    |              ||   ...and here (use `ref _b` or `ref mut _b`)
69    |              |hint: to prevent move, use `ref _a` or `ref mut _a`
70    |              cannot move out of here
71
72 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
73   --> $DIR/borrowck-vec-pattern-nesting.rs:72:13
74    |
75 LL |     let a = vec[0];
76    |             ^^^^^^
77    |             |
78    |             cannot move out of here
79    |             help: consider using a reference instead: `&vec[0]`
80
81 error: aborting due to 8 previous errors
82
83 Some errors have detailed explanations: E0506, E0508.
84 For more information about an error, try `rustc --explain E0506`.