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

@@ -39,12 +39,15 @@ pub enum CVec<T> {
struct DtorRes {
dtor: Option<fn@()>,
drop {
}
impl DtorRes : Drop {
fn finalize() {
match self.dtor {
option::None => (),
option::Some(f) => f()
}
}
}
}
fn DtorRes(dtor: Option<fn@()>) -> DtorRes {