about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-07-01 05:21:03 +0900
committerGitHub <noreply@github.com>2021-07-01 05:21:03 +0900
commit9e007e71ff02e53e5c44906d210201325b627f2a (patch)
treed9d2313b0b31b6bb0fe56040e933d0fda2093ac8
parent7714a9a0e347cc34c83bb0971ca918a550988c05 (diff)
parent7c9445d4a78909e324c5190759d1a015e7a48990 (diff)
downloadrust-9e007e71ff02e53e5c44906d210201325b627f2a.tar.gz
rust-9e007e71ff02e53e5c44906d210201325b627f2a.zip
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>
-rw-r--r--library/alloc/src/raw_vec.rs1
1 files changed, 0 insertions, 1 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 2e2c9b76bd4..d11d4031f77 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -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");