about summary refs log tree commit diff
path: root/tests/ui/never_patterns/check.rs
blob: 9b02fc7996d694aefa559efbb14a5b4f33843f45 (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
27
28
29
30
31
#![feature(never_patterns)]
#![allow(incomplete_features)]

enum Void {}

fn main() {}

macro_rules! never {
    () => { ! }
}

fn no_arms_or_guards(x: Void) {
    match None::<Void> {
        Some(!) => {}
        None => {}
    }
    match None::<Void> {
        //~^ ERROR non-exhaustive
        Some(!) if true,
        None => {}
    }
    match None::<Void> {
        //~^ ERROR non-exhaustive
        Some(!) if true => {}
        None => {}
    }
    match None::<Void> {
        Some(never!()) => {},
        None => {}
    }
}