Skip to content

Commit

Permalink
Rollup merge of rust-lang#86755 - ojeda:shrink, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.

Found in Rust-for-Linux/linux#402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
JohnTitor authored Jun 30, 2021
2 parents 7714a9a + 7c9445d commit 9e007e7
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 9e007e7

Please sign in to comment.