mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 11:51:31 +03:00
core: Inherit the finally module
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -37,4 +37,5 @@
|
||||
|
||||
/* 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;
|
||||
|
||||
Reference in New Issue
Block a user