rust/src/test/run-pass/struct-literal-dtor.rs

14 lines
154 B
Rust
Raw Normal View History

struct foo {
x: ~str,
}
impl foo : Drop {
fn finalize() {
error!("%s", self.x);
}
}
fn main() {
let _z = foo { x: ~"Hello" };
}