Skip to content

Commit a7374b8

Browse files
committed
Add reexport of Box<[T; N]>::Iter, add A = Global default to it
1 parent f1ca4a5 commit a7374b8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

library/alloc/src/boxed.rs

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ mod iter;
215215
/// [`ThinBox`] implementation.
216216
mod thin;
217217

218+
#[stable(feature = "boxed_array_value_iter", since = "CURRENT_RUSTC_VERSION")]
219+
pub use iter::BoxedArrayIntoIter;
218220
#[unstable(feature = "thin_box", issue = "92791")]
219221
pub use thin::ThinBox;
220222

library/alloc/src/boxed/iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use core::pin::Pin;
77
use core::task::{Context, Poll};
88
use core::{ptr, slice};
99

10-
use crate::alloc::Allocator;
10+
use crate::alloc::{Allocator, Global};
1111
#[cfg(not(no_global_oom_handling))]
1212
use crate::borrow::Cow;
1313
use crate::boxed::Box;
@@ -214,7 +214,7 @@ impl<'a, const N: usize, I, A: Allocator> !Iterator for &'a mut Box<[I; N], A> {
214214
/// A by-value `Box<[T; N]>` iterator.
215215
#[stable(feature = "boxed_array_value_iter", since = "CURRENT_RUSTC_VERSION")]
216216
#[rustc_insignificant_dtor]
217-
pub struct BoxedArrayIntoIter<T, const N: usize, A: Allocator> {
217+
pub struct BoxedArrayIntoIter<T, const N: usize, A: Allocator = Global> {
218218
/// This is the array we are iterating over.
219219
///
220220
/// Elements with index `i` where `alive.start <= i < alive.end` have not

0 commit comments

Comments
 (0)