2012-10-31 17:09:26 -05:00
|
|
|
trait Foo {
|
|
|
|
fn f();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar {
|
|
|
|
x: int,
|
2012-11-14 00:22:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Bar : Drop {
|
2012-11-28 17:42:16 -06:00
|
|
|
fn finalize(&self) {}
|
2012-10-31 17:09:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Bar : Foo {
|
|
|
|
fn f() {
|
|
|
|
io::println("hi");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = ~Bar { x: 10 };
|
|
|
|
let y = (move x) as ~Foo; //~ ERROR uniquely-owned trait objects must be copyable
|
|
|
|
let _z = copy y;
|
|
|
|
}
|
|
|
|
|