rustdoc icon indicating copy to clipboard operation
rustdoc copied to clipboard

Search for return type?

Open fschutt opened this issue 8 years ago • 3 comments

I wanted to give this as an idea, because it's a bit annoying with the current rustdoc:

If I have a struct or an enum, I often want to know "well, where do I get this struct from? Which function returns it?". The current rustdoc only searches in the function name, not actually in the return type.

So either it would be nice to have rustdoc search in the return type, too, or to make some sort of annotation on a struct / enum to "search the current project for functions that have something to do with struct / enum X". This should list functions that take X as a parameter and functions that have X in their return type.

Just an idea, thanks for reading.

fschutt avatar Sep 09 '17 04:09 fschutt

Existing Rustdoc has a limited form of this, https://doc.rust-lang.org/std/vec/struct.Vec.html?search=-%3E%20Vec

But yes, it's quite useful and should be improved!

steveklabnik avatar Sep 09 '17 16:09 steveklabnik

I think the newest rustdoc has this feature, should this be closed?

It seems to me as just docs.rs doesn't use the lastest rustdoc.

fschutt avatar Jan 07 '18 23:01 fschutt

This issue tracker is for the rustdoc re-write; we don't have this feature at all yet.

steveklabnik avatar Jan 07 '18 23:01 steveklabnik