1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // In theory, it doesn't matter what order destructors are run in for rust
12 // because we have explicit ownership of values meaning that there's no need to
13 // run one before another. With unsafe code, however, there may be a safe
14 // interface which relies on fields having their destructors run in a particular
15 // order. At the time of this writing, std::rt::sched::Scheduler is an example
16 // of a structure which contains unsafe handles to FFI-like types, and the
17 // destruction order of the fields matters in the sense that some handles need
18 // to get destroyed before others.
20 // In C++, destruction order happens bottom-to-top in order of field
21 // declarations, but we currently run them top-to-bottom. I don't think the
22 // order really matters that much as long as we define what it is.
24 // pretty-expanded FIXME #23616
33 static mut hit: bool = false;
53 let _c = C { a: A, b: B };