@@ -23,54 +23,68 @@ LL | _b.use_ref();
23
23
| -- borrow later used here
24
24
25
25
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
26
- --> $DIR/borrowck-vec-pattern-nesting.rs:44:15
26
+ --> $DIR/borrowck-vec-pattern-nesting.rs:43:11
27
27
|
28
+ LL | match vec {
29
+ | ^^^ cannot move out of here
28
30
LL | &mut [_a, //~ ERROR cannot move out
29
- | ^^ cannot move out of here
31
+ | -- help: to prevent move, use ref or ref mut: `ref _a`
30
32
31
33
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
32
34
--> $DIR/borrowck-vec-pattern-nesting.rs:57:13
33
35
|
34
36
LL | let a = vec[0]; //~ ERROR cannot move out
35
- | ^^^^^^ cannot move out of here
37
+ | ^^^^^^
38
+ | |
39
+ | cannot move out of here
40
+ | help: consider using a reference instead: `&vec[0]`
36
41
37
42
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
38
- --> $DIR/borrowck-vec-pattern-nesting.rs:67:10
43
+ --> $DIR/borrowck-vec-pattern-nesting.rs:64:11
39
44
|
45
+ LL | match vec {
46
+ | ^^^ cannot move out of here
47
+ ...
40
48
LL | _b] => {}
41
- | ^^ cannot move out of here
49
+ | -- help: to prevent move, use ref or ref mut: `ref _b`
42
50
43
51
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
44
52
--> $DIR/borrowck-vec-pattern-nesting.rs:70:13
45
53
|
46
54
LL | let a = vec[0]; //~ ERROR cannot move out
47
- | ^^^^^^ cannot move out of here
55
+ | ^^^^^^
56
+ | |
57
+ | cannot move out of here
58
+ | help: consider using a reference instead: `&vec[0]`
48
59
49
60
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
50
- --> $DIR/borrowck-vec-pattern-nesting.rs:78:15
61
+ --> $DIR/borrowck-vec-pattern-nesting.rs:77:11
51
62
|
52
- LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
53
- | ^^ cannot move out of here
54
-
55
- error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
56
- --> $DIR/borrowck-vec-pattern-nesting.rs:78:19
63
+ LL | match vec {
64
+ | ^^^ cannot move out of here
65
+ help: to prevent move, use ref or ref mut
57
66
|
58
- LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
59
- | ^^ cannot move out of here
60
-
61
- error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
62
- --> $DIR/borrowck-vec-pattern-nesting.rs:78:23
67
+ LL | &mut [ref _a, _b, _c] => {} //~ ERROR cannot move out
68
+ | ^^^^^^
69
+ help: to prevent move, use ref or ref mut
70
+ |
71
+ LL | &mut [_a, ref _b, _c] => {} //~ ERROR cannot move out
72
+ | ^^^^^^
73
+ help: to prevent move, use ref or ref mut
63
74
|
64
- LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
65
- | ^^ cannot move out of here
75
+ LL | &mut [_a, _b, ref _c] => {} //~ ERROR cannot move out
76
+ | ^^^^^^
66
77
67
78
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
68
79
--> $DIR/borrowck-vec-pattern-nesting.rs:82:13
69
80
|
70
81
LL | let a = vec[0]; //~ ERROR cannot move out
71
- | ^^^^^^ cannot move out of here
82
+ | ^^^^^^
83
+ | |
84
+ | cannot move out of here
85
+ | help: consider using a reference instead: `&vec[0]`
72
86
73
- error: aborting due to 10 previous errors
87
+ error: aborting due to 8 previous errors
74
88
75
89
Some errors occurred: E0506, E0508.
76
90
For more information about an error, try `rustc --explain E0506`.
0 commit comments