about summary refs log tree commit diff
path: root/src/librustc_data_structures/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-23 18:38:16 +0000
committerbors <bors@rust-lang.org>2018-03-23 18:38:16 +0000
commitc08480fce0f39f5c9c6db6dde0dccb375ca0ab14 (patch)
tree32db4f9e696b8c5ba9d249bf05b4af6c40974e2d /src/librustc_data_structures/lib.rs
parent55e1104dd918a809d2751d325c11d59c85485a2e (diff)
parent0e6cd8b61a392cd80d575eaef86d12d9c3f9e2dc (diff)
Auto merge of #49308 - alexcrichton:rollup, r=alexcrichton
Rollup of 15 pull requests

- Successful merges: #48265, #48528, #48552, #48624, #48883, #48909, #49028, #49030, #49102, #49160, #49169, #49203, #49262, #49272, #49295
- Failed merges: #48942, #49035
Diffstat (limited to 'src/librustc_data_structures/lib.rs')
-rw-r--r--src/librustc_data_structures/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index 81246aea1b5..bf0b3726bb3 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -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() {}