From 4f30a24e42137149373311f20525ac52cff44d94 Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Wed, 5 Dec 2018 18:59:48 +0100 Subject: Inline tweaks --- src/librustc_data_structures/lib.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index bc2b8f1d652..9d0201a9e38 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -113,12 +113,14 @@ pub struct OnDrop(pub F); impl OnDrop { /// 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 Drop for OnDrop { + #[inline] fn drop(&mut self) { (self.0)(); } -- cgit 1.4.1-3-g733a5