]> git.proxmox.com Git - rustc.git/blame - src/test/ui/repeat-to-run-dtor-twice.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / repeat-to-run-dtor-twice.rs
CommitLineData
223e47cc
LB
1// Tests that one can't run a destructor twice with the repeated vector
2// literal syntax.
3
4struct Foo {
1a4d82fc 5 x: isize,
223e47cc
LB
6
7}
8
9impl Drop for Foo {
1a4d82fc
JJ
10 fn drop(&mut self) {
11 println!("Goodbye!");
223e47cc
LB
12 }
13}
14
15fn main() {
16 let a = Foo { x: 3 };
1a4d82fc 17 let _ = [ a; 5 ];
1b1a35ee 18 //~^ ERROR the trait bound `Foo: Copy` is not satisfied [E0277]
223e47cc 19}