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:
parent
868c702d0c
commit
7c9445d4a7
@ -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");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user