Skip to content

Un-greppability of impls #9996

Closed
Closed
@alexcrichton

Description

@alexcrichton

I just realized that while rust source code is traditionally very greppable, finding implementations of a trait or struct is a diffcult thing to do.

In theory, I want to do grep "impl Type" to see what implements it, but type parameters throw a wrench into this by having lots of intermediate characters.

I realized this while reading over some rustdoc headers, and for example it's actually still a little difficult to see what traits a HashMap implements: http://static.rust-lang.org/doc/master/std/hashmap/struct.HashMap.html. There's a lot of noise going on there with the declaration of all the type parameters.

I was thinking of changing rustdoc to do something like impl Trait for Type where <Type, Parameters> which isn't the worst syntax, but it certainly loses our left-to-right readability.

I'm nominating this not because I think it's incredibly urgent to fix, but this does seem like a little bit of a wart which is only fixable before 1.0. I also may be the only one who finds this odd!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions