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

Trait methods with bounds on Self are shown on types that do not fulfill those bounds #100176

Closed
notriddle opened this issue Aug 5, 2022 · 8 comments · Fixed by #100221
Closed
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@notriddle
Copy link
Contributor

notriddle commented Aug 5, 2022

Location

https://doc.rust-lang.org/std/collections/hash_map/struct.Keys.html#method.rev

Summary

Found in this topic on URLO.

It shows the method Iterator::rev on the page for hash_map::Keys. This is misleading, because you can't actually call that method, because Keys: !DoubleEndedIterator.

@notriddle notriddle added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Aug 5, 2022
@chenyukang
Copy link
Member

@rustbot claim

@chenyukang
Copy link
Member

The same issue with partition_in_place and rposition.

@notriddle do you know how to exclude these options from hash_map? I'm still digging with it, if hash_map has this kind of issue, other data structures maybe have similar kind of issue.

I think we need to check the trait bounds when generating the doc.

@notriddle
Copy link
Contributor Author

I expect you want to do it while cleaning — turning the rustc IR into rustdoc's own IR — or earlier. Doing it later would mean reimplementing parts of rustc's type checker using rustdoc's IR, and nobody wants to do that.

@compiler-errors
Copy link
Member

compiler-errors commented Aug 5, 2022

For the record I was working on this, sorry for not claiming this... Anyways, let me know if you don't get around to this, and I'll pick it back up 😸 . Seems like you've claimed a few issues in the past hours @chenyukang, so not sure which ones you've gotten started with.

@chenyukang chenyukang removed their assignment Aug 6, 2022
@chenyukang
Copy link
Member

chenyukang commented Aug 6, 2022

For the record I was working on this, sorry for not claiming this... Anyways, let me know if you don't get around to this, and I'll pick it back up 😸 . Seems like you've claimed a few issues in the past hours @chenyukang, so not sure which ones you've gotten started with.

I haven't started this one, released it, please go ahead.
It's funny and also helpful to learn some Rust internals, I'm starting with some trivial fixes 😁

@compiler-errors
Copy link
Member

Thank you @chenyukang. Sorry for the mistake, and I am excited for you to get involved more in the compiler :)

@rustbot claim

@compiler-errors
Copy link
Member

This is a dupe of #80481

@compiler-errors compiler-errors closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2022
@compiler-errors
Copy link
Member

Uh, sorry, actually not a dupe. That's impl level, this is method level. I think there were legitimate concerns with hiding whole impls in that other issue. Reopening this, andf I'll probably solve this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants