You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is useful if one is explaining where a method/functionality comes from to be able to link the specific impl ... for X on the page for X. E.g. I'm just now writing something about string slicing, so it would be nice to be able to point to the impl Index<Range<usize>> for str part of http://doc.rust-lang.org/nightly/std/primitive.str.html .
👍 This would be quite useful, I just wanted to point out to a friend why String + &str is possible, but there is no way to point to this particular implementation. This is especially annoying since this implementation is rather well documented.
This should be a fairly small change, so i'm opening it up to new contributors. in src/librustdoc/html/render.rs, there's a function called render_impl that has some code at the top that prints the impl line. The change to fix this would be to add a spot in between where it prints i.inner_impl() and the next print to add an anchor link that points to the h3 right there. There's a function available called derive_id that you can hand a potential id to that will make sure you get a unique anchor for your link. Actually inserting the anchor can be done like in #43747 so you get a nice section marker that pops up on hover.
If you'd like to work on this and want help, let me know! I'm "misdreavus" on IRC. I'd love to get you acclimated to working on rustdoc.
Activity
[-]Allow linking to specific impls rustdoc[/-][+]Allow linking to specific impls in rustdoc[/+]steveklabnik commentedon Jun 6, 2016
Triage: no change here
mcarton commentedon Jun 28, 2017
👍 This would be quite useful, I just wanted to point out to a friend why
String + &stris possible, but there is no way to point to this particular implementation. This is especially annoying since this implementation is rather well documented.QuietMisdreavus commentedon Aug 15, 2017
This should be a fairly small change, so i'm opening it up to new contributors. in
src/librustdoc/html/render.rs, there's a function calledrender_implthat has some code at the top that prints the impl line. The change to fix this would be to add a spot in between where it printsi.inner_impl()and the next print to add an anchor link that points to theh3right there. There's a function available calledderive_idthat you can hand a potentialidto that will make sure you get a unique anchor for your link. Actually inserting the anchor can be done like in #43747 so you get a nice section marker that pops up on hover.If you'd like to work on this and want help, let me know! I'm "misdreavus" on IRC. I'd love to get you acclimated to working on rustdoc.
Add links for impls
Rollup merge of rust-lang#43979 - Jouan:Add-links-for-impls, r=Guilla…
QuietMisdreavus commentedon Aug 27, 2017
Since #43979 got merged, i'll close out this issue.
Merge pull request rust-lang#23552 from ChayimFriedman2/fix-status-msg