Skip to content

Commit

Permalink
alloc: RawVec<T, A>::shrink can be in no_global_oom_handling.
Browse files Browse the repository at this point in the history
Found in Rust-for-Linux/linux#402.

Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Jun 30, 2021
1 parent 868c702 commit 7c9445d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion library/alloc/src/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ impl<T, A: Allocator> RawVec<T, A> {
Ok(())
}

#[cfg(not(no_global_oom_handling))]
fn shrink(&mut self, amount: usize) -> Result<(), TryReserveError> {
assert!(amount <= self.capacity(), "Tried to shrink to a larger capacity");

Expand Down

0 comments on commit 7c9445d

Please sign in to comment.