mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
17 lines
302 B
Rust
17 lines
302 B
Rust
#![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() {}
|