]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr
Auto merge of #56534 - xfix:copied, r=@SimonSapin
[rust.git] / src / test / ui / borrowck / borrowck-move-out-from-array.ast.stderr
1 error[E0382]: use of moved value: `a[..]`
2   --> $DIR/borrowck-move-out-from-array.rs:10:14
3    |
4 LL |     let [_, _x] = a;
5    |             -- value moved here
6 LL |     let [.., _y] = a; //[ast]~ ERROR [E0382]
7    |              ^^ value used here after move
8    |
9    = note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
10
11 error[E0382]: use of moved value: `a[..]`
12   --> $DIR/borrowck-move-out-from-array.rs:17:10
13    |
14 LL |     let [_x, _] = a;
15    |          -- value moved here
16 LL |     let [_y..] = a; //[ast]~ ERROR [E0382]
17    |          ^^ value used here after move
18    |
19    = note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
20
21 error: aborting due to 2 previous errors
22
23 For more information about this error, try `rustc --explain E0382`.