rust/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs
2012-11-07 12:34:32 -08:00

26 lines
292 B
Rust

struct Foo {
x: int
}
trait Bar : Drop {
fn blah();
}
impl Foo : Drop {
fn finalize() {
io::println("kaboom");
}
}
impl Foo : Bar {
fn blah() {
self.finalize(); //~ ERROR explicit call to destructor
}
}
fn main() {
let x = Foo { x: 3 };
}