about summary refs log tree commit diff
path: root/tests/ui/rfcs/rfc-2005-default-binding-mode/box.rs
blob: de8afd95a84a9e5c1cd9570f61f2481ca05391f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ run-pass
#![allow(unreachable_patterns)]
#![feature(box_patterns)]

struct Foo{}

pub fn main() {
    let b = Box::new(Foo{});
    let box f = &b;
    let _: &Foo = f;

    match &&&b {
        box f => {
            let _: &Foo = f;
        },
        _ => panic!(),
    }
}