Skip to content

Commit

Permalink
no_global_oom_handling is so annoying :(
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Apr 27, 2024
1 parent 01617bb commit dc7e707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion library/alloc/src/vec/into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use core::iter::{
TrustedRandomAccessNoCoerce,
};
use core::marker::PhantomData;
use core::mem::{ManuallyDrop, SizedTypeProperties};
use core::mem::ManuallyDrop;
#[cfg(not(no_global_oom_handling))]
use core::mem::SizedTypeProperties;
use core::num::NonZero;
#[cfg(not(no_global_oom_handling))]
use core::ops::Deref;
Expand Down Expand Up @@ -128,6 +130,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.drain.forget_remaining();
}
Expand Down
4 changes: 1 addition & 3 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ use core::marker::PhantomData;
use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
use core::ops::{self, Index, IndexMut, Range, RangeBounds};
use core::ptr::{self, NonNull};
#[cfg(not(no_global_oom_handling))]
use core::slice::DrainRaw;
use core::slice::{self, SliceIndex};
use core::slice::{self, DrainRaw, SliceIndex};

use crate::alloc::{Allocator, Global};
use crate::borrow::{Cow, ToOwned};
Expand Down

0 comments on commit dc7e707

Please sign in to comment.