alloc: RawVec<T, A>::shrink can be in no_global_oom_handling.

Found in https://github.com/Rust-for-Linux/linux/pull/402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Miguel Ojeda 2021-06-30 19:41:49 +02:00
parent 868c702d0c
commit 7c9445d4a7

View File

@ -463,7 +463,6 @@ fn grow_exact(&mut self, len: usize, additional: usize) -> Result<(), TryReserve
Ok(()) Ok(())
} }
#[cfg(not(no_global_oom_handling))]
fn shrink(&mut self, amount: usize) -> Result<(), TryReserveError> { fn shrink(&mut self, amount: usize) -> Result<(), TryReserveError> {
assert!(amount <= self.capacity(), "Tried to shrink to a larger capacity"); assert!(amount <= self.capacity(), "Tried to shrink to a larger capacity");