Skip to content

Commit 8b0a25d

Browse files
committed
fix: Ensure Guard's drop method is removed at opt-level=s for Copy types
Added `#[inline]` to the `drop` method in the `Guard` implementation to ensure that the method is removed by the compiler at optimization level `opt-level=s` for `Copy` types. This change aims to align the method's behavior with optimization expectations and ensure it does not affect performance.
1 parent 7680a3c commit 8b0a25d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: core/src/array/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ impl<T> Guard<'_, T> {
889889
}
890890

891891
impl<T> Drop for Guard<'_, T> {
892+
#[inline]
892893
fn drop(&mut self) {
893894
debug_assert!(self.initialized <= self.array_mut.len());
894895

0 commit comments

Comments
 (0)