about summary refs log tree commit diff
path: root/src/test/run-pass/struct-literal-dtor.rs
blob: 27fdbcc07b9fe08cd74f00df8a9ff50fc9907869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct foo {
    x: ~str,
}

impl foo : Drop {
    fn finalize(&self) {
        error!("%s", self.x);
    }
}

fn main() {
    let _z = foo { x: ~"Hello" };
}