Convert libstd to use the Drop trait

This commit is contained in:
Ben Striegel
2012-11-13 21:38:18 -05:00
committed by Brian Anderson
parent 4b0e1336b2
commit 4589597785
8 changed files with 107 additions and 52 deletions

View File

@@ -217,7 +217,10 @@ fn check_poison(is_mutex: bool, failed: bool) {
#[doc(hidden)]
struct PoisonOnFail {
failed: &mut bool,
drop {
}
impl PoisonOnFail : Drop {
fn finalize() {
/* assert !*self.failed; -- might be false in case of cond.wait() */
if task::failing() { *self.failed = true; }
}