]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-4972.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-4972.rs
1 #![feature(box_patterns)]
2
3 trait MyTrait {
4     fn dummy(&self) {}
5 }
6
7 pub enum TraitWrapper {
8     A(Box<dyn MyTrait + 'static>),
9 }
10
11 fn get_tw_map(tw: &TraitWrapper) -> &dyn MyTrait {
12     match *tw {
13         TraitWrapper::A(box ref map) => map, //~ ERROR cannot be dereferenced
14     }
15 }
16
17 pub fn main() {}