2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2013-08-12 20:18:47 -07:00
|
|
|
pub enum Thing {
|
2019-05-28 14:47:21 -04:00
|
|
|
A(Box<dyn Foo+'static>)
|
2013-08-12 20:18:47 -07:00
|
|
|
}
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub trait Foo {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
2013-08-12 20:18:47 -07:00
|
|
|
|
|
|
|
pub struct Struct;
|
|
|
|
|
|
|
|
impl Foo for Struct {}
|
|
|
|
|
|
|
|
pub fn main() {
|
2022-07-07 04:36:10 +02:00
|
|
|
match Thing::A(Box::new(Struct) as Box<dyn Foo + 'static>) {
|
2015-01-25 22:05:03 +01:00
|
|
|
Thing::A(_a) => 0,
|
2013-08-12 20:18:47 -07:00
|
|
|
};
|
|
|
|
}
|