3 // Ensures that destructors are run for expressions of the form "e;" where
4 // `e` is a type which requires a destructor.
7 #![allow(path_statements)]
12 static mut NUM_DROPS: usize = 0;
16 unsafe { NUM_DROPS += 1; }
22 unsafe { NUM_DROPS += 1; }
27 assert_eq!(unsafe { NUM_DROPS }, 0);
28 { let _a = A { n: 1 }; }
29 assert_eq!(unsafe { NUM_DROPS }, 1);
31 assert_eq!(unsafe { NUM_DROPS }, 2);
34 assert_eq!(unsafe { NUM_DROPS }, 3);
36 assert_eq!(unsafe { NUM_DROPS }, 4);