rust
rust copied to clipboard
Trait methods with bounds on `Self` are shown on types that do not fulfill those bounds
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
.
@rustbot claim
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.
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.
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 :smile_cat: . Seems like you've claimed a few issues in the past hours @chenyukang, so not sure which ones you've gotten started with.
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 😁
Thank you @chenyukang. Sorry for the mistake, and I am excited for you to get involved more in the compiler :)
@rustbot claim
This is a dupe of #80481
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.