Skip to content

Commit f34830a

Browse files
authored
Update scopeguard.rs
I accidentally discovered that some minor changes in a production project will cause a lot of size increase and some performance regression. After comparison, I found a lot of `ScopeGuard::drop` symbols appeared in the poorer version. I suspect this is because the compiler missed some inline. for `ScopeGuard`, it should always be beneficial to inline it.
1 parent de77272 commit f34830a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scopeguard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<T, F> Drop for ScopeGuard<T, F>
4242
where
4343
F: FnMut(&mut T),
4444
{
45-
#[cfg_attr(feature = "inline-more", inline)]
45+
#[inline]
4646
fn drop(&mut self) {
4747
(self.dropfn)(&mut self.value)
4848
}

0 commit comments

Comments
 (0)