3 #![allow(unused_variables)]
5 // Drop works for union itself.
7 #![feature(untagged_unions)]
25 unsafe { CHECK += 1; }
31 unsafe { CHECK += 1; }
35 static mut CHECK: u8 = 0;
43 assert_eq!(CHECK, 1); // 1, dtor of U is called
47 assert_eq!(CHECK, 2); // 2, dtor of W is called
51 assert_eq!(CHECK, 2); // 2, Y has no dtor
56 assert_eq!(CHECK, 2); // 2, dtor of U *not* called for u2