summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-4972.rs
blob: fab258f137e68c66f683a3d6b34a7ca002ec4aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(box_patterns)]
#![feature(box_syntax)]

trait MyTrait {
    fn dummy(&self) {}
}

pub enum TraitWrapper {
    A(Box<dyn MyTrait + 'static>),
}

fn get_tw_map(tw: &TraitWrapper) -> &dyn MyTrait {
    match *tw {
        TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced
    }
}

pub fn main() {}