diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2021-01-31 01:47:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-31 01:47:29 +0100 |
| commit | 0793fab0c3e06105fce97aaf278de3137b820dfe (patch) | |
| tree | 77d9492bed573f3163a491e2ea40a183091cb8e5 | |
| parent | caf2c0652a2aa2db136abcc0a37c85bfb254e2cb (diff) | |
| parent | b50df6d31c0590f0e7033814973315ca878ab4ad (diff) | |
| download | rust-0793fab0c3e06105fce97aaf278de3137b820dfe.tar.gz rust-0793fab0c3e06105fce97aaf278de3137b820dfe.zip | |
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 https://github.com/rust-lang/rust/pull/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`
| -rw-r--r-- | library/core/src/slice/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 315df83115d..19a3b45e568 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -2852,13 +2852,12 @@ impl<T> [T] { /// # Examples /// /// ``` - /// #![feature(slice_fill_with)] - /// /// let mut buf = vec![1; 10]; /// buf.fill_with(Default::default); /// assert_eq!(buf, vec![0; 10]); /// ``` - #[unstable(feature = "slice_fill_with", issue = "79221")] + #[doc(alias = "memset")] + #[stable(feature = "slice_fill_with", since = "1.51.0")] pub fn fill_with<F>(&mut self, mut f: F) where F: FnMut() -> T, |
