mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 21:47:04 +00:00
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.
This commit is contained in:
parent
c7b0d4e81f
commit
bca0c5f2a9
@ -889,6 +889,7 @@ impl<T> Guard<'_, T> {
|
||||
}
|
||||
|
||||
impl<T> Drop for Guard<'_, T> {
|
||||
#[inline]
|
||||
fn drop(&mut self) {
|
||||
debug_assert!(self.initialized <= self.array_mut.len());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user