Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64671fa

Browse files
committed
Stabilizeslice_flatten
1 parent23bb5bc commit64671fa

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

‎alloc/src/vec/mod.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,15 +2643,13 @@ impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
26432643
/// # Examples
26442644
///
26452645
/// ```
2646-
/// #![feature(slice_flatten)]
2647-
///
26482646
/// let mut vec = vec![[1, 2, 3], [4, 5, 6], [7, 8, 9]];
26492647
/// assert_eq!(vec.pop(), Some([7, 8, 9]));
26502648
///
26512649
/// let mut flattened = vec.into_flattened();
26522650
/// assert_eq!(flattened.pop(), Some(6));
26532651
/// ```
2654-
#[unstable(feature ="slice_flatten",issue ="95629")]
2652+
#[stable(feature ="slice_flatten",since ="CURRENT_RUSTC_VERSION")]
26552653
pubfninto_flattened(self) ->Vec<T,A>{
26562654
let(ptr, len, cap, alloc) =self.into_raw_parts_with_alloc();
26572655
let(new_len, new_cap) =ifT::IS_ZST{

‎alloc/tests/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(const_str_from_utf8)]
3737
#![feature(panic_update_hook)]
3838
#![feature(pointer_is_aligned_to)]
39-
#![feature(slice_flatten)]
4039
#![feature(thin_box)]
4140
#![feature(strict_provenance)]
4241
#![feature(drain_keep_rest)]

‎core/src/slice/mod.rs‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4531,8 +4531,6 @@ impl<T, const N: usize> [[T; N]] {
45314531
/// # Examples
45324532
///
45334533
/// ```
4534-
/// #![feature(slice_flatten)]
4535-
///
45364534
/// assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
45374535
///
45384536
/// assert_eq!(
@@ -4546,7 +4544,8 @@ impl<T, const N: usize> [[T; N]] {
45464544
/// let empty_slice_of_arrays: &[[u32; 10]] = &[];
45474545
/// assert!(empty_slice_of_arrays.as_flattened().is_empty());
45484546
/// ```
4549-
#[unstable(feature ="slice_flatten", issue ="95629")]
4547+
#[stable(feature ="slice_flatten", since ="CURRENT_RUSTC_VERSION")]
4548+
#[rustc_const_unstable(feature ="const_slice_flatten", issue ="95629")]
45504549
pubconstfnas_flattened(&self) ->&[T]{
45514550
let len =ifT::IS_ZST{
45524551
self.len().checked_mul(N).expect("slice len overflow")
@@ -4572,8 +4571,6 @@ impl<T, const N: usize> [[T; N]] {
45724571
/// # Examples
45734572
///
45744573
/// ```
4575-
/// #![feature(slice_flatten)]
4576-
///
45774574
/// fn add_5_to_all(slice: &mut [i32]) {
45784575
/// for i in slice {
45794576
/// *i += 5;
@@ -4584,7 +4581,7 @@ impl<T, const N: usize> [[T; N]] {
45844581
/// add_5_to_all(array.as_flattened_mut());
45854582
/// assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
45864583
/// ```
4587-
#[unstable(feature ="slice_flatten",issue ="95629")]
4584+
#[stable(feature ="slice_flatten",since ="CURRENT_RUSTC_VERSION")]
45884585
pubfnas_flattened_mut(&mutself) ->&mut[T]{
45894586
let len =ifT::IS_ZST{
45904587
self.len().checked_mul(N).expect("slice len overflow")

‎core/tests/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
#![feature(const_array_from_ref)]
113113
#![feature(const_slice_from_ref)]
114114
#![feature(waker_getters)]
115-
#![feature(slice_flatten)]
116115
#![feature(error_generic_member_access)]
117116
#![feature(error_in_core)]
118117
#![feature(trait_upcasting)]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp