core: Inherit the finally module

This commit is contained in:
Alex Crichton
2014-04-30 20:34:41 -07:00
parent 7192452545
commit 85a8e6b80a
3 changed files with 9 additions and 1 deletions
@@ -30,11 +30,17 @@
```
*/
#![experimental]
use ops::Drop;
#[cfg(test)] use task::failing;
/// A trait for executing a destructor unconditionally after a block of code,
/// regardless of whether the blocked fails.
pub trait Finally<T> {
/// Executes this object, unconditionally running `dtor` after this block of
/// code has run.
fn finally(&mut self, dtor: ||) -> T;
}
+1
View File
@@ -37,4 +37,5 @@
/* Core types and methods on primitives */
pub mod finally;
pub mod char;
+2 -1
View File
@@ -13,9 +13,10 @@
use prelude::*;
use libc::uintptr_t;
pub use core::finally;
pub mod dynamic_lib;
pub mod finally;
pub mod simd;
pub mod sync;
pub mod mutex;