summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/bindings-after-at/nested-patterns.rs
blob: f06563d56cb06df497dd1279cb43b8272d70fb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass


struct A { a: u8, b: u8 }

pub fn main() {
    match (A { a: 10, b: 20 }) {
        ref x @ A { ref a, b: 20 } => {
            assert_eq!(x.a, 10);
            assert_eq!(*a, 10);
        }
        A { b: ref _b, .. } => panic!(),
    }
}