Closed
Description
This compiles, but segfaults when run:
pub enum Thing {
A(~Foo)
}
pub trait Foo {}
pub struct Struct;
impl Foo for Struct {}
fn main() {
match A(~Struct as ~Foo) {
A(a) => 0,
};
}
The segfault goes away when you do the following:
- Convert
A(a) => 0
toA(_) => 0
- Change all the unique pointers to managed pointers
- Change the tag from
A(~Foo)
toA(~Struct)
(and remove the cast)