Skip to content

Commit

Permalink
Rollup merge of rust-lang#79213 - yoshuawuyts:stabilize-slice-fill, r…
Browse files Browse the repository at this point in the history
…=m-ou-se

Stabilize `core::slice::fill`

Tracking issue rust-lang#70758

Stabilizes the `core::slice::fill` API in Rust 1.50, adding a `memset` doc alias so people coming from C/C++ looking for this operation can find it in the docs. This API hasn't seen any changes since we changed the signature in rust-lang#71165, and it seems like the right time to propose stabilization. Thanks!

r? `@m-ou-se`
  • Loading branch information
Dylan-DPC committed Dec 20, 2020
2 parents c1d5843 + 52eade1 commit db4905a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2581,14 +2581,12 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// #![feature(slice_fill)]
///
/// let mut buf = vec![0; 10];
/// buf.fill(1);
/// assert_eq!(buf, vec![1; 10]);
/// ```
#[doc(alias = "memset")]
#[unstable(feature = "slice_fill", issue = "70758")]
#[stable(feature = "slice_fill", since = "1.50.0")]
pub fn fill(&mut self, value: T)
where
T: Clone,
Expand Down

0 comments on commit db4905a

Please sign in to comment.