]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repeat-to-run-dtor-twice.rs
Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
[rust.git] / src / test / ui / repeat-to-run-dtor-twice.rs
1 // Tests that one can't run a destructor twice with the repeated vector
2 // literal syntax.
3
4 struct Foo {
5     x: isize,
6
7 }
8
9 impl Drop for Foo {
10     fn drop(&mut self) {
11         println!("Goodbye!");
12     }
13 }
14
15 fn main() {
16     let a = Foo { x: 3 };
17     let _ = [ a; 5 ];
18     //~^ ERROR `Foo: std::marker::Copy` is not satisfied
19 }