Skip to content

Add popcount and popcnt as doc aliases for count_ones methods. - #80097

Merged
bors merged 1 commit into
rust-lang:masterfrom
SimonSapin:popcount
Dec 17, 2020
Merged

Add popcount and popcnt as doc aliases for count_ones methods.#80097
bors merged 1 commit into
rust-lang:masterfrom
SimonSapin:popcount

Conversation

@SimonSapin

Copy link
Copy Markdown
Contributor

Integer types have a count_ones method that end up calling intrinsics::ctpop. On some architectures, that intrinsic is translated as a corresponding CPU instruction know as "popcount" or "popcnt".

This PR makes it so that searching for those names in rustdoc shows those methods.

CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 16, 2020
@m-ou-se

m-ou-se commented Dec 16, 2020

Copy link
Copy Markdown
Member

Looks like you accidentally made two of these changes on count_zeros instead of count_ones.

But other than that, r=me.

Integer types have a `count_ones` method that end up calling
`intrinsics::ctpop`.
On some architectures, that intrinsic is translated as a corresponding
CPU instruction know as "popcount" or "popcnt".
This PR makes it so that searching for those names in rustdoc shows those methods.
CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases
@SimonSapin

Copy link
Copy Markdown
ContributorAuthor

Good catch! Fixed

@m-ou-se

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Dec 16, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit f365de3 has been approved by m-ou-se

@borsbors 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 Dec 16, 2020
@JohnTitorJohnTitor mentioned this pull request Dec 17, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 17, 2020
Rollup of 11 pull requests
Successful merges:
- rust-lang#79051 (Implement if-let match guards)
- rust-lang#79877 (Allow `since="TBD"` for rustc_deprecated)
- rust-lang#79882 (Fix issue rust-lang#78496)
- rust-lang#80026 (expand-yaml-anchors: Make the output directory separator-insensitive)
- rust-lang#80039 (Remove unused `TyEncoder::tcx` required method)
- rust-lang#80069 (Test that `core::assert!` is valid)
- rust-lang#80072 (Fixed conflict with drop elaboration and coverage)
- rust-lang#80073 (Add support for target aliases)
- rust-lang#80082 (Revert rust-lang#78790 - rust-src vendoring)
- rust-lang#80097 (Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.)
- rust-lang#80103 (Remove docs for non-existent parameters in `rustc_expand`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit e4735dd into rust-lang:masterDec 17, 2020
@rustbotrustbot added this to the 1.50.0 milestone Dec 17, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@SimonSapin@rust-highfive@m-ou-se@bors@rustbot