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

rustdoc: impls should link to their source #30416

Closed
geofft opened this issue Dec 16, 2015 · 1 comment
Closed

rustdoc: impls should link to their source #30416

geofft opened this issue Dec 16, 2015 · 1 comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@geofft
Copy link
Contributor

geofft commented Dec 16, 2015

rustdoc pages for struct include a link to the source of the struct itself, at the top of the page. It would also be convenient if rustdoc had linked to the source (with line numbers) of each trait implementation it lists. There are two reasons for this:

  1. impls can come from a different source file than the struct itself; they can come from the file where the trait was defined. Common examples include Ext traits and the primitive types (which have no source of their own). But in these cases, the implementation shows up on the struct's documentation page.
  2. It's pretty common to use a macro to implement a trait, which means that it's hard to find visually where the impl is coming from. For instance, this line is the impl Iterator for core::slice::Iter.

And then you have cases where both of these are true....

@geofft
Copy link
Contributor Author

geofft commented Dec 16, 2015

Linking to the source of methods would also be very nice, and I'd guess is easy to implement at the same time, but they tend to be easier to find.

@alexcrichton alexcrichton added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 16, 2015
birkenfeld added a commit to birkenfeld/rust that referenced this issue May 6, 2016
Since these impls can be scattered around quite a bit, it is nice
to be able to jump to the location where individual methods and
trait impls are defined.

Fixes: rust-lang#30416
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
steveklabnik added a commit to steveklabnik/rust that referenced this issue May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
steveklabnik added a commit to steveklabnik/rust that referenced this issue May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants