blob: 9c95a9794766bd18f5101b817d4a134bbdb2ebfc (
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<MyTrait+'static>),
}
fn get_tw_map(tw: &TraitWrapper) -> &MyTrait {
match *tw {
TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced
}
}
pub fn main() {}
|