]> git.proxmox.com Git - rustc.git/blame - src/test/ui/zero-sized/zero-size-type-destructors.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / zero-sized / zero-size-type-destructors.rs
CommitLineData
b7449926
XL
1// run-pass
2#![allow(non_upper_case_globals)]
3
c34b1796 4static mut destructions : isize = 3;
1a4d82fc
JJ
5
6pub 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
18pub fn main() {
1a4d82fc 19 foo();
62682a34 20 assert_eq!(unsafe { destructions }, 0);
223e47cc 21}