-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #79181 - aDotInTheVoid:provided-method-source-link, r…
…=jyn514,GuillaumeGomez rustdoc: add [src] links to methods on a trait's page Closes #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
- Loading branch information
Showing
3 changed files
with
55 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#![crate_name = "quix"] | ||
pub trait Foo { | ||
// @has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#4"]' '[src]' | ||
fn required(); | ||
|
||
// @has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' '[src]' | ||
fn provided() {} | ||
} | ||
|
||
pub struct Bar; | ||
|
||
impl Foo for Bar { | ||
// @has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#14"]' '[src]' | ||
fn required() {} | ||
// @has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' '[src]' | ||
} | ||
|
||
pub struct Baz; | ||
|
||
impl Foo for Baz { | ||
// @has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#22"]' '[src]' | ||
fn required() {} | ||
|
||
// @has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#25"]' '[src]' | ||
fn provided() {} | ||
} |