diff options
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index 9e29b2798d8..066e1739841 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -112,12 +112,14 @@ pub struct OnDrop<F: Fn()>(pub F); impl<F: Fn()> OnDrop<F> { /// Forgets the function which prevents it from running. /// Ensure that the function owns no memory, otherwise it will be leaked. + #[inline] pub fn disable(self) { std::mem::forget(self); } } impl<F: Fn()> Drop for OnDrop<F> { + #[inline] fn drop(&mut self) { (self.0)(); } |
