Add OnDrop

This commit is contained in:
John Kåre Alsaker 2018-03-15 10:38:12 +01:00
parent 8e5eb025a2
commit 37f9c7ff82

View File

@ -76,6 +76,14 @@ pub mod flock;
pub mod sync;
pub mod owning_ref;
pub struct OnDrop<F: Fn()>(pub F);
impl<F: Fn()> Drop for OnDrop<F> {
fn drop(&mut self) {
(self.0)();
}
}
// See comments in src/librustc/lib.rs
#[doc(hidden)]
pub fn __noop_fix_for_27438() {}