diff options
| author | QuietMisdreavus <grey@quietmisdreavus.net> | 2017-07-27 13:26:24 -0500 |
|---|---|---|
| committer | QuietMisdreavus <grey@quietmisdreavus.net> | 2017-07-27 13:26:24 -0500 |
| commit | c9bdd518eb64c0072dae0df01ce67fedf728adb4 (patch) | |
| tree | f0b9f2afdc4753ca12ae8260ee48639d5655e26c /src | |
| parent | 5669c9988f50788b5ab5dee2d4538519d4e5663d (diff) | |
add [src] links to associated functions inside an impl block
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/render.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 9b1d256304d..43cabc97119 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2939,7 +2939,15 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi write!(w, "<code>")?; render_assoc_item(w, item, link.anchor(&id), ItemType::Impl)?; write!(w, "</code>")?; - render_stability_since_raw(w, item.stable_since(), outer_version)?; + if let Some(l) = (Item { cx, item }).src_href() { + write!(w, "</span><span class='out-of-band'>")?; + write!(w, "<div class='ghost'></div>")?; + render_stability_since_raw(w, item.stable_since(), outer_version)?; + write!(w, "<a class='srclink' href='{}' title='{}'>[src]</a>", + l, "goto source code")?; + } else { + render_stability_since_raw(w, item.stable_since(), outer_version)?; + } write!(w, "</span></h4>\n")?; } } diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 9314f57359a..858ef3bf411 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -297,6 +297,10 @@ h3.impl > .out-of-band { font-size: 21px; } +h4.method > .out-of-band { + font-size: 19px; +} + h4 > code, h3 > code, .invisible > code { position: inherit; } |
