Skip to content

Commit 17f1fcf

Browse files
authored
Rollup merge of rust-lang#148048 - thaliaarchi:stabilize-maybeuninit-write-slice, r=Mark-Simulacrum
Stabilize `maybe_uninit_write_slice` Stabilize feature `maybe_uninit_write_slice` (closes rust-lang#79995). Note that this also const-stabilizes `<[MaybeUninit<_>]>::write_copy_of_slice`. That method depends on `<[_]>::copy_from_slice`, which is already const-stable, and `<[MaybeUninit<_>]>::assume_init_mut` which is now also stable.
2 parents 1be6b13 + 5088b38 commit 17f1fcf

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

library/core/src/mem/maybe_uninit.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ impl<T> [MaybeUninit<T>] {
11281128
/// # Examples
11291129
///
11301130
/// ```
1131-
/// #![feature(maybe_uninit_write_slice)]
11321131
/// use std::mem::MaybeUninit;
11331132
///
11341133
/// let mut dst = [MaybeUninit::uninit(); 32];
@@ -1140,8 +1139,6 @@ impl<T> [MaybeUninit<T>] {
11401139
/// ```
11411140
///
11421141
/// ```
1143-
/// #![feature(maybe_uninit_write_slice)]
1144-
///
11451142
/// let mut vec = Vec::with_capacity(32);
11461143
/// let src = [0; 16];
11471144
///
@@ -1157,7 +1154,8 @@ impl<T> [MaybeUninit<T>] {
11571154
/// ```
11581155
///
11591156
/// [`write_clone_of_slice`]: slice::write_clone_of_slice
1160-
#[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
1157+
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
1158+
#[rustc_const_stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
11611159
pub const fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
11621160
where
11631161
T: Copy,
@@ -1188,7 +1186,6 @@ impl<T> [MaybeUninit<T>] {
11881186
/// # Examples
11891187
///
11901188
/// ```
1191-
/// #![feature(maybe_uninit_write_slice)]
11921189
/// use std::mem::MaybeUninit;
11931190
///
11941191
/// let mut dst = [const { MaybeUninit::uninit() }; 5];
@@ -1203,8 +1200,6 @@ impl<T> [MaybeUninit<T>] {
12031200
/// ```
12041201
///
12051202
/// ```
1206-
/// #![feature(maybe_uninit_write_slice)]
1207-
///
12081203
/// let mut vec = Vec::with_capacity(32);
12091204
/// let src = ["rust", "is", "a", "pretty", "cool", "language"].map(|s| s.to_string());
12101205
///
@@ -1220,7 +1215,7 @@ impl<T> [MaybeUninit<T>] {
12201215
/// ```
12211216
///
12221217
/// [`write_copy_of_slice`]: slice::write_copy_of_slice
1223-
#[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
1218+
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
12241219
pub fn write_clone_of_slice(&mut self, src: &[T]) -> &mut [T]
12251220
where
12261221
T: Clone,
@@ -1415,7 +1410,7 @@ impl<T> [MaybeUninit<T>] {
14151410
/// # Examples
14161411
///
14171412
/// ```
1418-
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_write_slice, maybe_uninit_slice)]
1413+
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_slice)]
14191414
/// use std::mem::MaybeUninit;
14201415
///
14211416
/// let uninit = [MaybeUninit::new(0x1234u16), MaybeUninit::new(0x5678u16)];
@@ -1442,7 +1437,7 @@ impl<T> [MaybeUninit<T>] {
14421437
/// # Examples
14431438
///
14441439
/// ```
1445-
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_write_slice, maybe_uninit_slice)]
1440+
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_slice)]
14461441
/// use std::mem::MaybeUninit;
14471442
///
14481443
/// let mut uninit = [MaybeUninit::<u16>::uninit(), MaybeUninit::<u16>::uninit()];

library/coretests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
#![feature(lazy_get)]
8282
#![feature(maybe_uninit_fill)]
8383
#![feature(maybe_uninit_uninit_array_transpose)]
84-
#![feature(maybe_uninit_write_slice)]
8584
#![feature(min_specialization)]
8685
#![feature(never_type)]
8786
#![feature(new_range_api)]

library/proc_macro/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ rustc-literal-escaper = { version = "0.0.5", features = ["rustc-dep-of-std"] }
1414
[features]
1515
default = ["rustc-dep-of-std"]
1616
rustc-dep-of-std = []
17+
18+
[lints.rust]
19+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }

library/proc_macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#![feature(staged_api)]
2323
#![feature(allow_internal_unstable)]
2424
#![feature(decl_macro)]
25-
#![feature(maybe_uninit_write_slice)]
25+
#![cfg_attr(bootstrap, feature(maybe_uninit_write_slice))]
2626
#![feature(negative_impls)]
2727
#![feature(panic_can_unwind)]
2828
#![feature(restricted_std)]

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@
349349
#![feature(lazy_get)]
350350
#![feature(maybe_uninit_array_assume_init)]
351351
#![feature(maybe_uninit_slice)]
352-
#![feature(maybe_uninit_write_slice)]
353352
#![feature(panic_can_unwind)]
354353
#![feature(panic_internals)]
355354
#![feature(pin_coerce_unsized_trait)]

0 commit comments

Comments
 (0)