]> git.lizzy.rs Git - rust.git/blob - src/test/ui/destructuring-assignment/slice_destructure_fail.stderr
Add underscore expressions for destructuring assignments
[rust.git] / src / test / ui / destructuring-assignment / slice_destructure_fail.stderr
1 error: `..` can only be used once per slice pattern
2   --> $DIR/slice_destructure_fail.rs:5:14
3    |
4 LL |   [a, .., b, ..] = [0, 1];
5    |       --     ^^ can only be used once per slice pattern
6    |       |
7    |       previously used here
8
9 error[E0527]: pattern requires 3 elements but array has 2
10   --> $DIR/slice_destructure_fail.rs:6:3
11    |
12 LL |   [a, a, b] = [1, 2];
13    |   ^^^^^^^^^ expected 2 elements
14
15 error[E0527]: pattern requires 1 element but array has 2
16   --> $DIR/slice_destructure_fail.rs:7:3
17    |
18 LL |   [_] = [1, 2];
19    |   ^^^ expected 2 elements
20
21 error: aborting due to 3 previous errors
22
23 For more information about this error, try `rustc --explain E0527`.