core: Inherit the finally module
This commit is contained in:
parent
7192452545
commit
85a8e6b80a
3 changed files with 9 additions and 1 deletions
|
|
@ -30,11 +30,17 @@ use std::unstable::finally::Finally;
|
|||
```
|
||||
*/
|
||||
|
||||
#![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;
|
||||
}
|
||||
|
||||
|
|
@ -37,4 +37,5 @@ pub mod container;
|
|||
|
||||
/* Core types and methods on primitives */
|
||||
|
||||
pub mod finally;
|
||||
pub mod char;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue