Skip to content
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

Methods of core trait that have doc aliases are found twice #81696

Open
KamilaBorowska opened this issue Feb 3, 2021 · 4 comments
Open

Methods of core trait that have doc aliases are found twice #81696

KamilaBorowska opened this issue Feb 3, 2021 · 4 comments
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate A-doc-alias Area: `#[doc(alias)]` C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@KamilaBorowska
Copy link
Contributor

KamilaBorowska commented Feb 3, 2021

If you search for a method in core trait that has an alias it appears twice on the list.

For example:

https://doc.rust-lang.org/nightly/std/?search=length

This shows core::iter::ExactSizeIterator::len twice.

image

This issue is also shown by https://doc.rust-lang.org/nightly/std/?search=reduce.

@KamilaBorowska KamilaBorowska added the C-bug Category: This is a bug. label Feb 3, 2021
@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 3, 2021
@jyn514 jyn514 added the A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate label Feb 3, 2021
@camelid camelid added the A-doc-alias Area: `#[doc(alias)]` label Feb 3, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 4, 2021

Relevant code:

for alias in item.attrs.get_doc_aliases() {
for alias in item.attrs.get_doc_aliases() {

@poliorcetics
Copy link
Contributor

poliorcetics commented Feb 5, 2021

Works for <=, + and presumably all other operators too.

Screenshot 2021-02-05 at 18 16 10

https://doc.rust-lang.org/nightly/std/?search=%2B

Edit: My bad, this is because of the reexport, so it is the same trait but not seen as the same path

@poliorcetics

This comment has been minimized.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 9, 2021
…crum

Add "every" as a doc alias for "all".

This matches [Array#every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) in JavaScript.

Oddly enough, `core::iter::Iterator::all` appears twice. This appears to be a rustdoc bug which I decided to fill in as rust-lang#81696.

![image](https://user-images.githubusercontent.com/1297598/106717890-94f43e80-6600-11eb-9428-2cd425823df9.png)
@lolbinarycat
Copy link
Contributor

triage: seems like this was "solved" just by removing the doc aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate A-doc-alias Area: `#[doc(alias)]` C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants