rust/src/test/ui/issues/issue-4972.rs
2019-05-29 00:57:31 -04:00

19 lines
326 B
Rust

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