Closed
Description
The following test:
struct foo {
x: int;
new(x: int) {
self.x = x;
}
drop {
error!{"Hello, world!"};
}
}
fn main() {
let x = ~foo(1);
error!{"x.x: %d", x.x};
let ~y <- x;
error!{"y.x: %d", y.x};
alt move y {
copy z {}
}
}
prints Hello World! three times. I think that patterns (both refutable/irrefutable, which are different code paths) just always copy in trans.