Rollup merge of #86755 - ojeda:shrink, r=Mark-Simulacrum
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:
commit
9e007e71ff
1 changed files with 0 additions and 1 deletions
|
@ -463,7 +463,6 @@ impl<T, A: Allocator> RawVec<T, A> {
|
||||||
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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue