summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/type-ascription-in-pattern.rs
blob: fec168afba1dde5484db1fc8e8817147a3c3189c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn foo(x: bool) -> i32 {
    match x {
        x: i32 => x, //~ ERROR expected
        //~^ ERROR mismatched types
        true => 42.,
        false => 0.333,
    }
}

fn main() {
    match foo(true) {
        42: i32 => (), //~ ERROR expected
        _: f64 => (), //~ ERROR expected
        x: i32 => (), //~ ERROR expected
    }
}