Skip to content

Commit

Permalink
Rollup merge of #79217 - yoshuawuyts:copy_from_slice-alias, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

Add the "memcpy" doc alias to slice::copy_from_slice

[RFC1419](rust-lang/rfcs#1419) describes `slice::copy_from_slice` as a "safe memcpy". This enables people searching for `memcpy` to find the `slice::copy_from_slice` method. Thanks!

## Screenshots

This is currently the output when searching for "memcpy" -- `copy_from_slice` is safe, and should be part of this list.

![Screenshot_2020-11-19 Results for memcpy - Rust](https://user-images.githubusercontent.com/2467194/99722964-c9e8fe80-2ab1-11eb-82a5-4afe703a0eea.png)
  • Loading branch information
Dylan-DPC authored Nov 19, 2020
2 parents 95da425 + 53f969d commit 5adc00f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2724,6 +2724,7 @@ impl<T> [T] {
///
/// [`clone_from_slice`]: #method.clone_from_slice
/// [`split_at_mut`]: #method.split_at_mut
#[doc(alias = "memcpy")]
#[stable(feature = "copy_from_slice", since = "1.9.0")]
pub fn copy_from_slice(&mut self, src: &[T])
where
Expand Down

0 comments on commit 5adc00f

Please sign in to comment.