Commit 5dc8421
authored
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:


#### after adding `#[doc(alias = "memcpy")]` and `#[doc(alias = "memmove")]`:

1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| 1518 | + | |
1518 | 1519 | | |
1519 | 1520 | | |
1520 | 1521 | | |
| |||
1579 | 1580 | | |
1580 | 1581 | | |
1581 | 1582 | | |
| 1583 | + | |
1582 | 1584 | | |
1583 | 1585 | | |
1584 | 1586 | | |
| |||
0 commit comments