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

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() {}