diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-05 18:59:48 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-21 12:09:43 +0100 |
| commit | 4f30a24e42137149373311f20525ac52cff44d94 (patch) | |
| tree | 96000e98815cd296ffeaaa5030af03888474ee78 /src/librustc_data_structures | |
| parent | 6d34ec18c7d7e574553f6347ecf08e1e1c45c13d (diff) | |
Inline tweaks
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 bc2b8f1d652..9d0201a9e38 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -113,12 +113,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)(); } |
