1
Fork 0
rust/src/test/ui/explicit/explicit-call-to-supertrait-dtor.rs

24 lines
310 B
Rust
Raw Normal View History

struct Foo {
x: isize
}
trait Bar : Drop {
fn blah(&self);
}
impl Drop for Foo {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {
println!("kaboom");
}
}
impl Bar for Foo {
fn blah(&self) {
self.drop(); //~ ERROR explicit use of destructor method
}
}
fn main() {
let x = Foo { x: 3 };
}