]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | // run-pass |
2 | #![allow(non_upper_case_globals)] | |
3 | ||
c34b1796 | 4 | static mut destructions : isize = 3; |
1a4d82fc JJ |
5 | |
6 | pub fn foo() { | |
1a4d82fc JJ |
7 | struct Foo; |
8 | ||
9 | impl Drop for Foo { | |
10 | fn drop(&mut self) { | |
11 | unsafe { destructions -= 1 }; | |
12 | } | |
fc512014 | 13 | } |
1a4d82fc JJ |
14 | |
15 | let _x = [Foo, Foo, Foo]; | |
16 | } | |
223e47cc LB |
17 | |
18 | pub fn main() { | |
1a4d82fc | 19 | foo(); |
62682a34 | 20 | assert_eq!(unsafe { destructions }, 0); |
223e47cc | 21 | } |