]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Auto merge of #101768 - sunfishcode:sunfishcode/wasi-stdio-lock-asfd, r=joshtriplett
[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:9:13
3    |
4 LL |         [box ref _a, _, _] => {
5    |              ------ borrow of `vec[_]` occurs here
6 LL |
7 LL |             vec[0] = Box::new(4);
8    |             ^^^^^^ assignment to borrowed `vec[_]` occurs here
9 LL |
10 LL |             _a.use_ref();
11    |             ------------ borrow later used here
12
13 error[E0506]: cannot assign to `vec[_]` because it is borrowed
14   --> $DIR/borrowck-vec-pattern-nesting.rs:23:13
15    |
16 LL |         &mut [ref _b @ ..] => {
17    |               ------ borrow of `vec[_]` occurs here
18 LL |
19 LL |             vec[0] = Box::new(4);
20    |             ^^^^^^ assignment to borrowed `vec[_]` occurs here
21 LL |
22 LL |             _b.use_ref();
23    |             ------------ borrow later used here
24
25 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
26   --> $DIR/borrowck-vec-pattern-nesting.rs:34:11
27    |
28 LL |     match vec {
29    |           ^^^ cannot move out of here
30 ...
31 LL |         &mut [_a,
32    |               --
33    |               |
34    |               data moved here
35    |               move occurs because `_a` has type `Box<isize>`, which does not implement the `Copy` trait
36    |
37 help: consider removing the `&mut`
38    |
39 LL ~         [_a,
40 LL +
41 LL +
42 LL +
43 LL +             ..
44 LL ~         ] => {
45    |
46
47 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
48   --> $DIR/borrowck-vec-pattern-nesting.rs:46:13
49    |
50 LL |     let a = vec[0];
51    |             ^^^^^^
52    |             |
53    |             cannot move out of here
54    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
55    |             help: consider borrowing here: `&vec[0]`
56
57 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
58   --> $DIR/borrowck-vec-pattern-nesting.rs:55:11
59    |
60 LL |     match vec {
61    |           ^^^ cannot move out of here
62 ...
63 LL |          _b] => {}
64    |          --
65    |          |
66    |          data moved here
67    |          move occurs because `_b` has type `Box<isize>`, which does not implement the `Copy` trait
68    |
69 help: consider removing the `&mut`
70    |
71 LL ~         [
72 LL +
73 LL ~          _b] => {}
74    |
75
76 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
77   --> $DIR/borrowck-vec-pattern-nesting.rs:65:13
78    |
79 LL |     let a = vec[0];
80    |             ^^^^^^
81    |             |
82    |             cannot move out of here
83    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
84    |             help: consider borrowing here: `&vec[0]`
85
86 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
87   --> $DIR/borrowck-vec-pattern-nesting.rs:74:11
88    |
89 LL |     match vec {
90    |           ^^^ cannot move out of here
91 ...
92 LL |         &mut [_a, _b, _c] => {}
93    |         -----------------
94    |         |     |   |   |
95    |         |     |   |   ...and here
96    |         |     |   ...and here
97    |         |     data moved here
98    |         help: consider removing the `&mut`: `[_a, _b, _c]`
99    |
100    = note: move occurs because these variables have types that don't implement the `Copy` trait
101
102 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
103   --> $DIR/borrowck-vec-pattern-nesting.rs:85:13
104    |
105 LL |     let a = vec[0];
106    |             ^^^^^^
107    |             |
108    |             cannot move out of here
109    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
110    |             help: consider borrowing here: `&vec[0]`
111
112 error: aborting due to 8 previous errors
113
114 Some errors have detailed explanations: E0506, E0508.
115 For more information about an error, try `rustc --explain E0506`.