3 #![allow(non_upper_case_globals)]
5 // In theory, it doesn't matter what order destructors are run in for rust
6 // because we have explicit ownership of values meaning that there's no need to
7 // run one before another. With unsafe code, however, there may be a safe
8 // interface which relies on fields having their destructors run in a particular
9 // order. At the time of this writing, std::rt::sched::Scheduler is an example
10 // of a structure which contains unsafe handles to FFI-like types, and the
11 // destruction order of the fields matters in the sense that some handles need
12 // to get destroyed before others.
14 // In C++, destruction order happens bottom-to-top in order of field
15 // declarations, but we currently run them top-to-bottom. I don't think the
16 // order really matters that much as long as we define what it is.
26 static mut hit: bool = false;
46 let _c = C { a: A, b: B };