Skip to content

Commit 0793fab

Browse files
Rollup merge of #81048 - yoshuawuyts:stabilize-core-slice-fill-with, r=m-ou-se
Stabilize `core::slice::fill_with` _Tracking issue: https://github.com/rust-lang/rust/issues/79221_ This stabilizes the `slice_fill_with` feature for Rust 1.51, following the stabilization of `slice_fill` in 1.50. This was requested by libs team members in #79213. This PR also adds the "memset" alias for `slice::fill_with`, mirroring the alias set on the `slice::fill` sibling API. This will ensure someone looking for "memset" will find both variants. r? `@Amanieu`
2 parents caf2c06 + b50df6d commit 0793fab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/core/src/slice/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2852,13 +2852,12 @@ impl<T> [T] {
28522852
/// # Examples
28532853
///
28542854
/// ```
2855-
/// #![feature(slice_fill_with)]
2856-
///
28572855
/// let mut buf = vec![1; 10];
28582856
/// buf.fill_with(Default::default);
28592857
/// assert_eq!(buf, vec![0; 10]);
28602858
/// ```
2861-
#[unstable(feature = "slice_fill_with", issue = "79221")]
2859+
#[doc(alias = "memset")]
2860+
#[stable(feature = "slice_fill_with", since = "1.51.0")]
28622861
pub fn fill_with<F>(&mut self, mut f: F)
28632862
where
28642863
F: FnMut() -> T,

0 commit comments

Comments
 (0)