Files
rust/src/test/ui/issues/issue-4972.rs

19 lines
316 B
Rust
Raw Normal View History

#![feature(box_patterns)]
#![feature(box_syntax)]
trait MyTrait {
fn dummy(&self) {}
}
2013-05-22 19:51:21 -07:00
pub enum TraitWrapper {
A(Box<MyTrait+'static>),
2013-05-22 19:51:21 -07:00
}
fn get_tw_map(tw: &TraitWrapper) -> &MyTrait {
2013-05-22 19:51:21 -07:00
match *tw {
TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced
2013-05-22 19:51:21 -07:00
}
}
pub fn main() {}