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