summary refs log tree commit diff
path: root/src/test/run-pass/struct-pattern-matching.rs
blob: e5e26d0b442472149681995d429c44c7fe7e085e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Foo {
    x: int,
    y: int,
}

fn main() {
    let a = Foo { x: 1, y: 2 };
    match a {
        Foo { x: x, y: y } => io::println(fmt!("yes, %d, %d", x, y))
    }
}