2012-08-17 16:12:07 -07:00
|
|
|
// Tests that one can't run a destructor twice with the repeated vector
|
|
|
|
// literal syntax.
|
|
|
|
|
|
|
|
struct Foo {
|
2015-01-08 21:54:35 +11:00
|
|
|
x: isize,
|
2012-08-17 16:12:07 -07:00
|
|
|
|
2012-11-14 01:22:37 -05:00
|
|
|
}
|
|
|
|
|
2013-02-14 11:47:00 -08:00
|
|
|
impl Drop for Foo {
|
2013-09-16 21:18:07 -04:00
|
|
|
fn drop(&mut self) {
|
2014-01-09 21:06:55 +11:00
|
|
|
println!("Goodbye!");
|
2012-08-17 16:12:07 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = Foo { x: 3 };
|
2014-12-20 15:20:51 +13:00
|
|
|
let _ = [ a; 5 ];
|
2020-09-02 10:40:56 +03:00
|
|
|
//~^ ERROR the trait bound `Foo: Copy` is not satisfied [E0277]
|
2012-08-17 16:12:07 -07:00
|
|
|
}
|