blob: a144fb3605132846808c4007dc003525362a85f5 [file] [edit]
//! Regression test for https://github.com/rust-lang/rust/issues/4972
#![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() {}