]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Link to the LLVM issue from a comment on `SpecOptionPartialEq`
[rust.git] / tests / 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 mutable borrow
38    |
39 LL -         &mut [_a,
40 LL +         [_a,
41    |
42
43 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
44   --> $DIR/borrowck-vec-pattern-nesting.rs:46:13
45    |
46 LL |     let a = vec[0];
47    |             ^^^^^^
48    |             |
49    |             cannot move out of here
50    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
51    |
52 help: consider borrowing here
53    |
54 LL |     let a = &vec[0];
55    |             +
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 mutable borrow
70    |
71 LL -         &mut [
72 LL +         [
73    |
74
75 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
76   --> $DIR/borrowck-vec-pattern-nesting.rs:65:13
77    |
78 LL |     let a = vec[0];
79    |             ^^^^^^
80    |             |
81    |             cannot move out of here
82    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
83    |
84 help: consider borrowing here
85    |
86 LL |     let a = &vec[0];
87    |             +
88
89 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
90   --> $DIR/borrowck-vec-pattern-nesting.rs:74:11
91    |
92 LL |     match vec {
93    |           ^^^ cannot move out of here
94 ...
95 LL |         &mut [_a, _b, _c] => {}
96    |               --  --  -- ...and here
97    |               |   |
98    |               |   ...and here
99    |               data moved here
100    |
101    = note: move occurs because these variables have types that don't implement the `Copy` trait
102 help: consider removing the mutable borrow
103    |
104 LL -         &mut [_a, _b, _c] => {}
105 LL +         [_a, _b, _c] => {}
106    |
107
108 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
109   --> $DIR/borrowck-vec-pattern-nesting.rs:85:13
110    |
111 LL |     let a = vec[0];
112    |             ^^^^^^
113    |             |
114    |             cannot move out of here
115    |             move occurs because `vec[_]` has type `Box<isize>`, which does not implement the `Copy` trait
116    |
117 help: consider borrowing here
118    |
119 LL |     let a = &vec[0];
120    |             +
121
122 error: aborting due to 8 previous errors
123
124 Some errors have detailed explanations: E0506, E0508.
125 For more information about an error, try `rustc --explain E0506`.