3 #![allow(unused_variables)]
5 // Drop works for union itself.
24 unsafe { CHECK += 1; }
30 unsafe { CHECK += 1; }
34 static mut CHECK: u8 = 0;
42 assert_eq!(CHECK, 1); // 1, dtor of U is called
46 assert_eq!(CHECK, 2); // 2, dtor of W is called
50 assert_eq!(CHECK, 2); // 2, Y has no dtor
55 assert_eq!(CHECK, 2); // 2, dtor of U *not* called for u2