summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/slice-patterns-irrefutable.rs
blob: cbf64e2c53d0243ae573d380861d936649a10da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// check-pass

fn main() {
    let s: &[bool] = &[true; 0];
    let s0: &[bool; 0] = &[];
    let s1: &[bool; 1] = &[false; 1];
    let s2: &[bool; 2] = &[false; 2];

    let [] = s0;
    let [_] = s1;
    let [_, _] = s2;

    let [..] = s;
    let [..] = s0;
    let [..] = s1;
    let [..] = s2;

    let [_, ..] = s1;
    let [.., _] = s1;
    let [_, ..] = s2;
    let [.., _] = s2;

    let [_, _, ..] = s2;
    let [_, .., _] = s2;
    let [.., _, _] = s2;
}