stabilize [T]::array_windows

This commit is contained in:
bendn
2025-11-11 13:46:52 +07:00
parent 2fb805367d
commit 919e46f4d4
16 changed files with 18 additions and 23 deletions
+1 -1
View File
@@ -5,8 +5,8 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(array_windows))]
#![doc(test(attr(deny(warnings), allow(internal_features))))]
#![feature(array_windows)]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
+1 -1
View File
@@ -10,9 +10,9 @@
#![allow(internal_features)]
#![allow(rustc::default_hash_types)]
#![allow(rustc::potential_query_instability)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![deny(unsafe_op_in_unsafe_fn)]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(assert_matches)]
+1 -1
View File
@@ -7,7 +7,7 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![allow(rustc::untranslatable_diagnostic)]
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(assert_matches)]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
+1 -1
View File
@@ -1,7 +1,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(associated_type_defaults)]
#![feature(if_let_guard)]
#![feature(macro_metavar_expr)]
+1 -1
View File
@@ -21,7 +21,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
+1 -1
View File
@@ -29,8 +29,8 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(associated_type_defaults)]
#![feature(box_as_ptr)]
+1 -1
View File
@@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(const_type_name)]
+1 -1
View File
@@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(file_buffered)]
#![feature(if_let_guard)]
#![feature(impl_trait_in_assoc_type)]
+1 -1
View File
@@ -17,8 +17,8 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))]
#![feature(array_windows)]
#![feature(cfg_select)]
#![feature(core_io_borrowed_buf)]
#![feature(if_let_guard)]
-1
View File
@@ -89,7 +89,6 @@
#![feature(alloc_layout_extra)]
#![feature(allocator_api)]
#![feature(array_into_iter_constructors)]
#![feature(array_windows)]
#![feature(ascii_char)]
#![feature(assert_matches)]
#![feature(async_fn_traits)]
+1 -1
View File
@@ -18,7 +18,7 @@
use core::mem::MaybeUninit;
#[cfg(not(no_global_oom_handling))]
use core::ptr;
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
pub use core::slice::ArrayWindows;
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
pub use core::slice::EscapeAscii;
+4 -6
View File
@@ -2187,8 +2187,6 @@ unsafe impl<T> Sync for ChunksExactMut<'_, T> where T: Sync {}
/// # Example
///
/// ```
/// #![feature(array_windows)]
///
/// let slice = [0, 1, 2, 3];
/// let mut iter = slice.array_windows::<2>();
/// assert_eq!(iter.next(), Some(&[0, 1]));
@@ -2200,7 +2198,7 @@ unsafe impl<T> Sync for ChunksExactMut<'_, T> where T: Sync {}
/// [`array_windows`]: slice::array_windows
/// [slices]: slice
#[derive(Debug, Clone, Copy)]
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct ArrayWindows<'a, T: 'a, const N: usize> {
v: &'a [T],
@@ -2213,7 +2211,7 @@ pub(super) const fn new(slice: &'a [T]) -> Self {
}
}
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N> {
type Item = &'a [T; N];
@@ -2250,7 +2248,7 @@ fn last(self) -> Option<Self::Item> {
}
}
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
impl<'a, T, const N: usize> DoubleEndedIterator for ArrayWindows<'a, T, N> {
#[inline]
fn next_back(&mut self) -> Option<&'a [T; N]> {
@@ -2269,7 +2267,7 @@ impl<'a, T, const N: usize> DoubleEndedIterator for ArrayWindows<'a, T, N> {
}
}
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
impl<T, const N: usize> ExactSizeIterator for ArrayWindows<'_, T, N> {
fn is_empty(&self) -> bool {
self.v.len() < N
+2 -3
View File
@@ -51,7 +51,7 @@
pub use index::SliceIndex;
#[unstable(feature = "slice_range", issue = "76393")]
pub use index::{range, try_range};
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
pub use iter::ArrayWindows;
#[stable(feature = "slice_group_by", since = "1.77.0")]
pub use iter::{ChunkBy, ChunkByMut};
@@ -1626,7 +1626,6 @@ pub const fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_
/// # Examples
///
/// ```
/// #![feature(array_windows)]
/// let slice = [0, 1, 2, 3];
/// let mut iter = slice.array_windows();
/// assert_eq!(iter.next().unwrap(), &[0, 1]);
@@ -1636,7 +1635,7 @@ pub const fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_
/// ```
///
/// [`windows`]: slice::windows
#[unstable(feature = "array_windows", issue = "75027")]
#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
#[inline]
#[track_caller]
-1
View File
@@ -5,7 +5,6 @@
#![feature(array_ptr_get)]
#![feature(array_try_from_fn)]
#![feature(array_try_map)]
#![feature(array_windows)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(async_iter_from_iter)]
+1 -1
View File
@@ -1,4 +1,4 @@
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![feature(box_patterns)]
#![feature(macro_metavar_expr_concat)]
#![feature(f128)]
+1 -1
View File
@@ -5,7 +5,7 @@
#![feature(rustc_private)]
#![feature(assert_matches)]
#![feature(unwrap_infallible)]
#![feature(array_windows)]
#![cfg_attr(bootstrap, feature(array_windows))]
#![recursion_limit = "512"]
#![allow(
clippy::missing_errors_doc,