about summary refs log tree commit diff
path: root/tests/ui/patterns.rs
blob: bd202fc04205816f657e28e732833f010798948b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-rustfix
#![allow(unused)]
#![warn(clippy::all)]

fn main() {
    let v = Some(true);
    let s = [0, 1, 2, 3, 4];
    match v {
        Some(x) => (),
        y @ _ => (),
    }
    match v {
        Some(x) => (),
        y @ None => (), // no error
    }
    match s {
        [x, inside @ .., y] => (), // no error
        [..] => (),
    }
}