Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

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

LunaBorowska 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

@LunaBorowska
Copy link
Contributor

LunaBorowska 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.

@LunaBorowska LunaBorowska 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.

# for free to join this conversation on GitHub. Already have an account? # 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