Skip to content

Commit 8e62f0f

Browse files
authored
Rollup merge of #143383 - fee1-dead-contrib:push-mstmlwuskxyy, r=dtolnay
stabilize `const_array_each_ref` cc #133289, needs FCP.
2 parents 125ff8a + 9370440 commit 8e62f0f

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
@@ -621,11 +621,11 @@ impl<T, const N: usize> [T; N] {
621621
/// assert_eq!(strings.len(), 3);
622622
/// ```
623623
#[stable(feature = "array_methods", since = "1.77.0")]
624-
#[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")]
624+
#[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")]
625625
pub const fn each_ref(&self) -> [&T; N] {
626626
let mut buf = [null::<T>(); N];
627627

628-
// 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.
628+
// 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.
629629
let mut i = 0;
630630
while i < N {
631631
buf[i] = &raw const self[i];
@@ -652,11 +652,11 @@ impl<T, const N: usize> [T; N] {
652652
/// assert_eq!(floats, [0.0, 2.7, -1.0]);
653653
/// ```
654654
#[stable(feature = "array_methods", since = "1.77.0")]
655-
#[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")]
655+
#[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")]
656656
pub const fn each_mut(&mut self) -> [&mut T; N] {
657657
let mut buf = [null_mut::<T>(); N];
658658

659-
// 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.
659+
// 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.
660660
let mut i = 0;
661661
while i < N {
662662
buf[i] = &raw mut self[i];

0 commit comments

Comments
 (0)