diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-08-21 01:12:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-21 01:12:13 -0400 |
| commit | 8e62f0f0c3d277b86b50882050357fa77f16e972 (patch) | |
| tree | c0e77547b9858f4ea780c5843fff9e7cf322c5ce /library/core/src/array | |
| parent | 125ff8a788c5d6a66917f499abdc00051afe6886 (diff) | |
| parent | 937044097b8fc23b387ab58fc233109551e8536f (diff) | |
| download | rust-8e62f0f0c3d277b86b50882050357fa77f16e972.tar.gz rust-8e62f0f0c3d277b86b50882050357fa77f16e972.zip | |
Rollup merge of #143383 - fee1-dead-contrib:push-mstmlwuskxyy, r=dtolnay
stabilize `const_array_each_ref` cc rust-lang/rust#133289, needs FCP.
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index b3a498570f9..bb75ec74c81 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -621,11 +621,11 @@ impl<T, const N: usize> [T; N] { /// assert_eq!(strings.len(), 3); /// ``` #[stable(feature = "array_methods", since = "1.77.0")] - #[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")] + #[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")] pub const fn each_ref(&self) -> [&T; N] { let mut buf = [null::<T>(); N]; - // 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. + // 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. let mut i = 0; while i < N { buf[i] = &raw const self[i]; @@ -652,11 +652,11 @@ impl<T, const N: usize> [T; N] { /// assert_eq!(floats, [0.0, 2.7, -1.0]); /// ``` #[stable(feature = "array_methods", since = "1.77.0")] - #[rustc_const_unstable(feature = "const_array_each_ref", issue = "133289")] + #[rustc_const_stable(feature = "const_array_each_ref", since = "CURRENT_RUSTC_VERSION")] pub const fn each_mut(&mut self) -> [&mut T; N] { let mut buf = [null_mut::<T>(); N]; - // 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. + // 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. let mut i = 0; while i < N { buf[i] = &raw mut self[i]; |
