fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
5.6 KiB143 linesraw
1error[E0382]: borrow of moved value: `a[..]`
2  --> $DIR/borrowck-move-out-from-array-use.rs:10:14
3   |
4LL |     let [_, _, _x] = a;
5   |                -- value moved here
6LL |     let [.., ref _y] = a;
7   |              ^^^^^^ value borrowed here after move
8   |
9   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
10
11error[E0382]: borrow of moved value: `a[..]`
12  --> $DIR/borrowck-move-out-from-array-use.rs:16:14
13   |
14LL |     let [_, _, (_x, _)] = a;
15   |                 -- value moved here
16LL |     let [.., ref _y] = a;
17   |              ^^^^^^ value borrowed here after partial move
18   |
19   = note: move occurs because `a[..].0` has type `std::string::String`, which does not implement the `Copy` trait
20
21error[E0382]: borrow of moved value: `a[..].0`
22  --> $DIR/borrowck-move-out-from-array-use.rs:22:15
23   |
24LL |     let [_, _, (_x, _)] = a;
25   |                 -- value moved here
26LL |     let [.., (ref _y, _)] = a;
27   |               ^^^^^^ value borrowed here after move
28   |
29   = note: move occurs because `a[..].0` has type `std::string::String`, which does not implement the `Copy` trait
30
31error[E0382]: borrow of moved value: `a`
32  --> $DIR/borrowck-move-out-from-array-use.rs:30:10
33   |
34LL |     let [_x, _, _] = a;
35   |          -- value moved here
36LL |     let [ref _y @ .., _, _] = a;
37   |          ^^^^^^^^^^^ value borrowed here after partial move
38   |
39   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
40
41error[E0382]: borrow of moved value: `a`
42  --> $DIR/borrowck-move-out-from-array-use.rs:36:16
43   |
44LL |     let [.., _x] = a;
45   |              -- value moved here
46LL |     let [_, _, ref _y @ ..] = a;
47   |                ^^^^^^^^^^^ value borrowed here after partial move
48   |
49   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
50
51error[E0382]: borrow of moved value: `a`
52  --> $DIR/borrowck-move-out-from-array-use.rs:42:10
53   |
54LL |     let [(_x, _), _, _] = a;
55   |           -- value moved here
56LL |     let [ref _y @ .., _, _] = a;
57   |          ^^^^^^^^^^^ value borrowed here after partial move
58   |
59   = note: move occurs because `a[..].0` has type `std::string::String`, which does not implement the `Copy` trait
60
61error[E0382]: borrow of moved value: `a`
62  --> $DIR/borrowck-move-out-from-array-use.rs:48:16
63   |
64LL |     let [.., (_x, _)] = a;
65   |               -- value moved here
66LL |     let [_, _, ref _y @ ..] = a;
67   |                ^^^^^^^^^^^ value borrowed here after partial move
68   |
69   = note: move occurs because `a[..].0` has type `std::string::String`, which does not implement the `Copy` trait
70
71error[E0382]: borrow of moved value: `a[..]`
72  --> $DIR/borrowck-move-out-from-array-use.rs:54:11
73   |
74LL |     let [_y @ .., _, _] = a;
75   |          ------- value moved here
76LL |     let [(ref _x, _), _, _] = a;
77   |           ^^^^^^ value borrowed here after move
78   |
79   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
80
81error[E0382]: borrow of moved value: `a[..]`
82  --> $DIR/borrowck-move-out-from-array-use.rs:60:15
83   |
84LL |     let [_, _, _y @ ..] = a;
85   |                ------- value moved here
86LL |     let [.., (ref _x, _)] = a;
87   |               ^^^^^^ value borrowed here after move
88   |
89   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
90
91error[E0382]: borrow of moved value: `a`
92  --> $DIR/borrowck-move-out-from-array-use.rs:68:13
93   |
94LL |     let [x @ .., _] = a;
95   |          ------ value moved here
96LL |     let [_, ref _y @ ..] = a;
97   |             ^^^^^^^^^^^ value borrowed here after partial move
98   |
99   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
100
101error[E0382]: use of moved value: `a`
102  --> $DIR/borrowck-move-out-from-array-use.rs:76:5
103   |
104LL |     let [_, _, _x] = a;
105   |                -- value moved here
106LL |     a[2] = Default::default();
107   |     ^^^^ value used here after partial move
108   |
109   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
110
111error[E0382]: use of moved value: `a`
112  --> $DIR/borrowck-move-out-from-array-use.rs:82:5
113   |
114LL |     let [_, _, (_x, _)] = a;
115   |                 -- value moved here
116LL |     a[2].1 = Default::default();
117   |     ^^^^ value used here after partial move
118   |
119   = note: move occurs because `a[..].0` has type `std::string::String`, which does not implement the `Copy` trait
120
121error[E0382]: use of moved value: `a`
122  --> $DIR/borrowck-move-out-from-array-use.rs:88:5
123   |
124LL |     let [_, _, _x @ ..] = a;
125   |                ------- value moved here
126LL |     a[0] = Default::default();
127   |     ^^^^ value used here after partial move
128   |
129   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
130
131error[E0382]: use of moved value: `a`
132  --> $DIR/borrowck-move-out-from-array-use.rs:94:5
133   |
134LL |     let [_, _, _x @ ..] = a;
135   |                ------- value moved here
136LL |     a[0].1 = Default::default();
137   |     ^^^^ value used here after partial move
138   |
139   = note: move occurs because `a[..]` has type `(std::string::String, std::string::String)`, which does not implement the `Copy` trait
140
141error: aborting due to 14 previous errors
142
143For more information about this error, try `rustc --explain E0382`.