rust/tests/ui/issues/issue-4972.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
302 B
Rust
Raw Normal View History

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