1
Fork 0

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 8336cad95d
commit 28c7a25151
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; }
}