]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Update tests for changes to cannot move errors
[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 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:24:13
15    |
16 LL |         &mut [ref _b..] => {
17    |               ------ borrow of `vec[_]` occurs here
18 LL |
19 LL |             vec[0] = box 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 `[std::boxed::Box<isize>]`, a non-copy slice
26   --> $DIR/borrowck-vec-pattern-nesting.rs:35: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 `std::boxed::Box<isize>`, which does not implement the `Copy` trait
36 help: consider removing the `&mut`
37    |
38 LL |         [_a,
39 LL |
40 LL |
41 LL |
42 LL |             ..
43 LL |         ] => {
44    |
45
46 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
47   --> $DIR/borrowck-vec-pattern-nesting.rs:47:13
48    |
49 LL |     let a = vec[0];
50    |             ^^^^^^
51    |             |
52    |             cannot move out of here
53    |             move occurs because `vec[_]` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
54    |             help: consider borrowing here: `&vec[0]`
55
56 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
57   --> $DIR/borrowck-vec-pattern-nesting.rs:56:11
58    |
59 LL |     match vec {
60    |           ^^^ cannot move out of here
61 ...
62 LL |          _b] => {}
63    |          --
64    |          |
65    |          data moved here
66    |          move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
67 help: consider removing the `&mut`
68    |
69 LL |         [
70 LL |
71 LL |          _b] => {}
72    |
73
74 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
75   --> $DIR/borrowck-vec-pattern-nesting.rs:66:13
76    |
77 LL |     let a = vec[0];
78    |             ^^^^^^
79    |             |
80    |             cannot move out of here
81    |             move occurs because `vec[_]` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
82    |             help: consider borrowing here: `&vec[0]`
83
84 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
85   --> $DIR/borrowck-vec-pattern-nesting.rs:75:11
86    |
87 LL |     match vec {
88    |           ^^^ cannot move out of here
89 ...
90 LL |         &mut [_a, _b, _c] => {}
91    |         -----------------
92    |         |     |   |   |
93    |         |     |   |   ...and here
94    |         |     |   ...and here
95    |         |     data moved here
96    |         help: consider removing the `&mut`: `[_a, _b, _c]`
97    |
98 note: move occurs because these variables have types that don't implement the `Copy` trait
99   --> $DIR/borrowck-vec-pattern-nesting.rs:78:15
100    |
101 LL |         &mut [_a, _b, _c] => {}
102    |               ^^  ^^  ^^
103
104 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
105   --> $DIR/borrowck-vec-pattern-nesting.rs:86:13
106    |
107 LL |     let a = vec[0];
108    |             ^^^^^^
109    |             |
110    |             cannot move out of here
111    |             move occurs because `vec[_]` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
112    |             help: consider borrowing here: `&vec[0]`
113
114 error: aborting due to 8 previous errors
115
116 Some errors have detailed explanations: E0506, E0508.
117 For more information about an error, try `rustc --explain E0506`.