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: add [src] links to methods on a trait's page #79181

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

aDotInTheVoid
Copy link
Member

Closes #45150

image

Caveats

  • The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour.

image

  • I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine.
  • I can't tell how src/librustdoc/html/render/mod.rs is structured, so I probably

@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @jyn514

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2020
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) A-trait-system Area: Trait system labels Nov 18, 2020
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! @GuillaumeGomez do you want to review the CSS changes? Otherwise r=me :)

@jyn514
Copy link
Member

jyn514 commented Nov 18, 2020

A small nit: if you can squash the last three commits together that would be nice, there are instructions at https://rustc-dev-guide.rust-lang.org/git.html#advanced-rebasing. No big deal if it's a hassle, though.

@jyn514 jyn514 assigned GuillaumeGomez and unassigned jyn514 Nov 18, 2020
@aDotInTheVoid aDotInTheVoid changed the title rustdoc: add [src] links to provided methods on a trait's page rustdoc: add [src] links to methods on a trait's page Nov 18, 2020
@aDotInTheVoid aDotInTheVoid force-pushed the provided-method-source-link branch from 082856e to ae644a2 Compare November 18, 2020 22:11
@GuillaumeGomez
Copy link
Member

Looks good to me, thanks!

@bors: r=jyn514,GuillaumeGomez

@bors
Copy link
Contributor

bors commented Nov 19, 2020

📌 Commit ae644a2 has been approved by jyn514,GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…e-link, r=jyn514,GuillaumeGomez

rustdoc: add [src] links to methods on a trait's page

Closes rust-lang#45150

![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png)

### Caveats

- The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour.

![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png)

- I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine.
- I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…e-link, r=jyn514,GuillaumeGomez

rustdoc: add [src] links to methods on a trait's page

Closes rust-lang#45150

![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png)

### Caveats

- The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour.

![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png)

- I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine.
- I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79119 (Clarify availability of atomic operations)
 - rust-lang#79123 (Add u128 and i128 integer tests)
 - rust-lang#79177 (Test drop order for (destructuring) assignments)
 - rust-lang#79181 (rustdoc: add [src] links to methods on a trait's page)
 - rust-lang#79183 (Make compiletest testing use the local sysroot)
 - rust-lang#79185 (expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute")
 - rust-lang#79193 (Revert rust-lang#78969 "Normalize function type during validation")
 - rust-lang#79194 (Make as{_mut,}_slice on array::IntoIter public)
 - rust-lang#79204 (Add jyn514 email alias to mailmap)
 - rust-lang#79212 (Move `rustc_ty` -> `rustc_ty_utils`)
 - rust-lang#79217 (Add the "memcpy" doc alias to slice::copy_from_slice)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 192ed76 into rust-lang:master Nov 20, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 20, 2020
@aDotInTheVoid aDotInTheVoid deleted the provided-method-source-link branch January 6, 2021 12:28
@m-ou-se
Copy link
Member

m-ou-se commented Jan 19, 2021

This feature is saving me so much time while looking up implementations of things in std. I keep switching to the nightly docs specifically so I can use this. :)

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) A-trait-system Area: Trait system S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: add [src] links to provided methods on a trait's page
7 participants