about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-24 20:10:13 +0100
committerGitHub <noreply@github.com>2020-02-24 20:10:13 +0100
commit3e7a18e5e5efb870b9c4c7c4bd7a310270187213 (patch)
tree3f5326b21e469c2c24a6471752b92d2b834ac79b /src/libstd/sys/unix/stack_overflow.rs
parentd91657877a44ecc9450b6d996bef577a1d1ec647 (diff)
parentad47bf50f6ff9d7a73e54bed6ab518c01ae2fdc5 (diff)
downloadrust-3e7a18e5e5efb870b9c4c7c4bd7a310270187213.tar.gz
rust-3e7a18e5e5efb870b9c4c7c4bd7a310270187213.zip
Rollup merge of #69391 - memoryruins:memalias, r=Mark-Simulacrum
Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`

This PR adds a [rustdoc alias](https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#add-aliases-for-an-item-in-documentation-search) to `ptr::copy` and `ptr::copy_nonoverlapping` using the commonly used terms `memcpy` and `memmove`. The motivation for this PR is to improve discoverability for these functions, since I've noticed users overlook these functions on multiple occasions (and they have thus reached for [libc](https://crates.io/crates/libc) without need). Currently std docs state:

https://doc.rust-lang.org/nightly/std/ptr/fn.copy_nonoverlapping.html
> `copy_nonoverlapping` is semantically equivalent to C's `memcpy`, but with the argument order swapped.

https://doc.rust-lang.org/nightly/std/ptr/fn.copy.html
> `copy` is semantically equivalent to C's `memmove`, but with the argument order swapped.

#### search results before adding a rustdoc alias:
![screenshot 6517](https://user-images.githubusercontent.com/6868531/75102985-78fbb680-55c2-11ea-8e41-04979e6fa6f6.png)
![screenshot 6518](https://user-images.githubusercontent.com/6868531/75102984-78632000-55c2-11ea-9673-8822aae636d1.png)

#### after adding `#[doc(alias = "memcpy")]` and `#[doc(alias = "memmove")]`:
![screenshot 6516](https://user-images.githubusercontent.com/6868531/75102986-78fbb680-55c2-11ea-93b9-1929be940043.png)
![screenshot 6515](https://user-images.githubusercontent.com/6868531/75102987-78fbb680-55c2-11ea-9861-ce8a77a0c3b9.png)
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions