2012-08-08 17:36:38 -05:00
|
|
|
// This test should behave exactly like issue-2735-2
|
2012-08-15 20:46:55 -05:00
|
|
|
struct defer {
|
2012-08-08 17:36:38 -05:00
|
|
|
let b: &mut bool;
|
|
|
|
new(b: &mut bool) {
|
|
|
|
self.b = b;
|
|
|
|
}
|
|
|
|
drop { *(self.b) = true; }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut dtor_ran = false;
|
|
|
|
defer(&mut dtor_ran);
|
|
|
|
assert(dtor_ran);
|
|
|
|
}
|