-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rustdoc aliases to ptr::copy
and ptr::copy_nonoverlapping
#69391
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Feb 23, 2020
Cc @rust-lang/docs I'm going to go ahead and approve this, because it feels like a clear win, though I think this is the first such use. Worst case we can always revert though as this isn't promising anything stable AFAICT. @bors r+ |
📌 Commit ad47bf5 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Feb 23, 2020
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Feb 24, 2020
…crum 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)
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Feb 24, 2020
…crum 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)
Nice indeed! |
bors
added a commit
that referenced
this pull request
Feb 25, 2020
Rollup of 6 pull requests Successful merges: - #69220 (Add documentation for the `-Zself-profile` flag) - #69391 (Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`) - #69427 (Cleanup e0368 e0369) - #69433 (don't explicitly compare against true or false) - #69435 (Replace uses of Cell::get + Cell::set with Cell::replace.) - #69437 (no more codegen for miri_start_panic) Failed merges: r? @ghost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a rustdoc alias to
ptr::copy
andptr::copy_nonoverlapping
using the commonly used termsmemcpy
andmemmove
. 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 without need). Currently std docs state:https://doc.rust-lang.org/nightly/std/ptr/fn.copy_nonoverlapping.html
https://doc.rust-lang.org/nightly/std/ptr/fn.copy.html
search results before adding a rustdoc alias:
after adding
#[doc(alias = "memcpy")]
and#[doc(alias = "memmove")]
: