summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfcs/rfc-2005-default-binding-mode/box.rs
blob: 0d1cded36b62d7b5e4dc058bb8e88cb072d03b3d (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!(),
    }
}