Skip to content

Commit ffaafa4

Browse files
committed
no_global_oom_handling is so annoying :(
1 parent e6834af commit ffaafa4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

library/alloc/src/vec/into_iter.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use core::iter::{
1111
TrustedRandomAccessNoCoerce,
1212
};
1313
use core::marker::PhantomData;
14-
use core::mem::{ManuallyDrop, SizedTypeProperties};
14+
use core::mem::ManuallyDrop;
15+
#[cfg(not(no_global_oom_handling))]
16+
use core::mem::SizedTypeProperties;
1517
use core::num::NonZero;
1618
#[cfg(not(no_global_oom_handling))]
1719
use core::ops::Deref;
@@ -128,6 +130,7 @@ impl<T, A: Allocator> IntoIter<T, A> {
128130
}
129131

130132
/// Forgets to Drop the remaining elements while still allowing the backing allocation to be freed.
133+
#[cfg(not(no_global_oom_handling))]
131134
pub(crate) fn forget_remaining_elements(&mut self) {
132135
self.drain.forget_remaining();
133136
}

library/alloc/src/vec/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ use core::marker::PhantomData;
6464
use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
6565
use core::ops::{self, Index, IndexMut, Range, RangeBounds};
6666
use core::ptr::{self, NonNull};
67-
#[cfg(not(no_global_oom_handling))]
68-
use core::slice::DrainRaw;
69-
use core::slice::{self, SliceIndex};
67+
use core::slice::{self, DrainRaw, SliceIndex};
7068

7169
use crate::alloc::{Allocator, Global};
7270
use crate::borrow::{Cow, ToOwned};

0 commit comments

Comments
 (0)