Skip to content

Commit

Permalink
Add tracking issue; make empty const too (unstably)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Dec 6, 2021
1 parent ef7c833 commit 0b90204
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/core/src/array/iter.rs
Expand Up @@ -141,8 +141,8 @@ impl<T, const N: usize> IntoIter<T, N> {
/// let r: IntoIter<_, 40> = next_chunk(&mut (10..16)).unwrap_err();
/// assert_eq!(r.collect::<Vec<_>>(), vec![10, 11, 12, 13, 14, 15]);
/// ```
#[unstable(feature = "array_into_iter_constructors", issue = "88888888")]
#[rustc_const_unstable(feature = "array_into_iter_constructors_const", issue = "88888888")]
#[unstable(feature = "array_into_iter_constructors", issue = "91583")]
#[rustc_const_unstable(feature = "const_array_into_iter_constructors", issue = "91583")]
pub const unsafe fn from_raw_parts(
buffer: [MaybeUninit<T>; N],
initialized: Range<usize>,
Expand Down Expand Up @@ -202,8 +202,9 @@ impl<T, const N: usize> IntoIter<T, N> {
/// assert_eq!(get_bytes(true).collect::<Vec<_>>(), vec![1, 2, 3, 4]);
/// assert_eq!(get_bytes(false).collect::<Vec<_>>(), vec![]);
/// ```
#[unstable(feature = "array_into_iter_constructors", issue = "88888888")]
pub fn empty() -> Self {
#[unstable(feature = "array_into_iter_constructors", issue = "91583")]
#[rustc_const_unstable(feature = "const_array_into_iter_constructors", issue = "91583")]
pub const fn empty() -> Self {
let buffer = MaybeUninit::uninit_array();
let initialized = 0..0;

Expand Down
2 changes: 2 additions & 0 deletions library/core/src/lib.rs
Expand Up @@ -101,6 +101,7 @@
#![feature(const_align_of_val)]
#![feature(const_alloc_layout)]
#![feature(const_arguments_as_str)]
#![feature(const_array_into_iter_constructors)]
#![feature(const_bigint_helper_methods)]
#![feature(const_caller_location)]
#![feature(const_cell_into_inner)]
Expand Down Expand Up @@ -138,6 +139,7 @@
#![feature(const_type_name)]
#![feature(const_default_impls)]
#![feature(duration_consts_float)]
#![feature(maybe_uninit_uninit_array)]
#![feature(ptr_metadata)]
#![feature(slice_ptr_get)]
#![feature(str_internals)]
Expand Down

0 comments on commit 0b90204

Please sign in to comment.