summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/issue-10392.rs
blob: 926fa94800eb12947e152de4b6df4d6b7674e88d (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
// run-pass
#![allow(unused_variables)]

struct A { foo: isize }
struct B { a: isize, b: isize, c: isize }

fn mka() -> A { panic!() }
fn mkb() -> B { panic!() }

fn test() {
    let A { foo, } = mka();
    let A {
        foo,
    } = mka();

    let B { a, b, c, } = mkb();

    match mka() {
        A { foo: _foo, } => {}
    }

    match Some(mka()) {
        Some(A { foo: _foo, }) => {}
        None => {}
    }
}

pub fn main() {
    if false { test() }
}