about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-29 18:42:19 +0000
committerbors <bors@rust-lang.org>2022-06-29 18:42:19 +0000
commitddcbba036aee08f0709f98a92a342a278eae5c05 (patch)
tree746cce42c59c782314757a884b2630e8e9d1c1c2 /library/alloc/src
parent3fcf43bb0f3e86c16a88f239da18a1729a94d244 (diff)
parentd34c4ca9be41d14d8eb460f23abb353ce3be8ae7 (diff)
downloadrust-ddcbba036aee08f0709f98a92a342a278eae5c05.tar.gz
rust-ddcbba036aee08f0709f98a92a342a278eae5c05.zip
Auto merge of #98680 - matthiaskrgr:rollup-1bkrrn9, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #98434 (Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line.)
 - #98636 (Triagebot: Fix mentions word wrapping.)
 - #98642 (Fix #98260)
 - #98643 (Improve pretty printing of valtrees for references)
 - #98646 (rustdoc: fix bugs in main.js popover help and settings)
 - #98647 (Update cargo)
 - #98652 (`alloc`: clean and ensure `no_global_oom_handling`  builds are warning-free)
 - #98660 (Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.)
 - #98665 (Use verbose help for deprecation suggestion)
 - #98668 (Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/boxed/thin.rs4
-rw-r--r--library/alloc/src/raw_vec.rs1
-rw-r--r--library/alloc/src/string.rs4
-rw-r--r--library/alloc/src/vec/into_iter.rs2
4 files changed, 8 insertions, 3 deletions
diff --git a/library/alloc/src/boxed/thin.rs b/library/alloc/src/boxed/thin.rs
index 203e5dff0c7..09308d4d090 100644
--- a/library/alloc/src/boxed/thin.rs
+++ b/library/alloc/src/boxed/thin.rs
@@ -3,7 +3,9 @@
 // by matthieu-m
 use crate::alloc::{self, Layout, LayoutError};
 use core::fmt::{self, Debug, Display, Formatter};
-use core::marker::{PhantomData, Unsize};
+use core::marker::PhantomData;
+#[cfg(not(no_global_oom_handling))]
+use core::marker::Unsize;
 use core::mem;
 use core::ops::{Deref, DerefMut};
 use core::ptr::Pointee;
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 4be5f6cf9ca..b0f4529abdf 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -421,6 +421,7 @@ impl<T, A: Allocator> RawVec<T, A> {
         Ok(())
     }
 
+    #[cfg(not(no_global_oom_handling))]
     fn shrink(&mut self, cap: usize) -> Result<(), TryReserveError> {
         assert!(cap <= self.capacity(), "Tried to shrink to a larger capacity");
 
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 88838807265..b1513e5e0f3 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -46,9 +46,9 @@
 use core::char::{decode_utf16, REPLACEMENT_CHARACTER};
 use core::fmt;
 use core::hash;
+use core::iter::FusedIterator;
 #[cfg(not(no_global_oom_handling))]
-use core::iter::FromIterator;
-use core::iter::{from_fn, FusedIterator};
+use core::iter::{from_fn, FromIterator};
 #[cfg(not(no_global_oom_handling))]
 use core::ops::Add;
 #[cfg(not(no_global_oom_handling))]
diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs
index 9b84a1d9b4b..28979457b7f 100644
--- a/library/alloc/src/vec/into_iter.rs
+++ b/library/alloc/src/vec/into_iter.rs
@@ -9,6 +9,7 @@ use core::iter::{
 };
 use core::marker::PhantomData;
 use core::mem::{self, ManuallyDrop};
+#[cfg(not(no_global_oom_handling))]
 use core::ops::Deref;
 use core::ptr::{self, NonNull};
 use core::slice::{self};
@@ -123,6 +124,7 @@ impl<T, A: Allocator> IntoIter<T, A> {
     }
 
     /// Forgets to Drop the remaining elements while still allowing the backing allocation to be freed.
+    #[cfg(not(no_global_oom_handling))]
     pub(crate) fn forget_remaining_elements(&mut self) {
         self.ptr = self.end;
     }