2012-08-17 18:12:07 -05:00
|
|
|
// Tests that one can't run a destructor twice with the repeated vector
|
|
|
|
// literal syntax.
|
|
|
|
|
|
|
|
struct Foo {
|
2012-09-07 16:50:47 -05:00
|
|
|
x: int,
|
2012-08-17 18:12:07 -05:00
|
|
|
|
2012-11-14 00:22:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo : Drop {
|
2012-11-28 17:42:16 -06:00
|
|
|
fn finalize(&self) {
|
2012-08-17 18:12:07 -05:00
|
|
|
io::println("Goodbye!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = Foo { x: 3 };
|
2012-08-17 19:11:25 -05:00
|
|
|
let _ = [ a, ..5 ]; //~ ERROR copying a noncopyable value
|
2012-08-17 18:12:07 -05:00
|
|
|
}
|
|
|
|
|