Skip to content

Commit 9370440

Browse files
committed
stabilize const_array_each_ref
1 parent 9e64506 commit 9370440

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/array/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,11 @@ impl<T, const N: usize> [T; N] {
618618
/// assert_eq!(strings.len(), 3);
619619
/// ```
620620
#[stable(feature = "array_methods", since = "1.77.0")]
621-
#[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")]
621+
#[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")]
622622
pub const fn each_ref(&self) -> [&T; N] {
623623
let mut buf = [null::<T>(); N];
624624

625-
// FIXME(const-hack): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
625+
// FIXME(const_trait_impl): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
626626
let mut i = 0;
627627
while i < N {
628628
buf[i] = &raw const self[i];
@@ -649,11 +649,11 @@ impl<T, const N: usize> [T; N] {
649649
/// assert_eq!(floats, [0.0, 2.7, -1.0]);
650650
/// ```
651651
#[stable(feature = "array_methods", since = "1.77.0")]
652-
#[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")]
652+
#[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")]
653653
pub const fn each_mut(&mut self) -> [&mut T; N] {
654654
let mut buf = [null_mut::<T>(); N];
655655

656-
// FIXME(const-hack): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
656+
// FIXME(const_trait_impl): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
657657
let mut i = 0;
658658
while i < N {
659659
buf[i] = &raw mut self[i];

0 commit comments

Comments
 (0)