Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,13 @@ fn render_deref_methods(w: &mut fmt::Formatter, cx: &Context, impl_: &Impl,
fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLink,
render_mode: RenderMode, outer_version: Option<&str>) -> fmt::Result {
if render_mode == RenderMode::Normal {
write!(w, "<h3 class='impl'><span class='in-band'><code>{}</code>", i.inner_impl())?;
let id = derive_id(match i.inner_impl().trait_ {
Some(ref t) => format!("impl-{}", Escape(&format!("{:#}", t))),
None => "impl".to_string(),
});
write!(w, "<h3 id='{}' class='impl'><span class='in-band'><code>{}</code>",
id, i.inner_impl())?;
write!(w, "<a href='#{}' class='anchor'></a>", id)?;
write!(w, "</span><span class='out-of-band'>")?;
let since = i.impl_item.stability.as_ref().map(|s| &s.since[..]);
if let Some(l) = (Item { item: &i.impl_item, cx: cx }).src_href() {
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ a {
.small-section-header:hover > .anchor {
display: initial;
}

.in-band:hover > .anchor {
display: initial;
}
.anchor {
display: none;
}
Expand Down
6 changes: 6 additions & 0 deletions src/librustdoc/html/static/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ h1.fqn {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD;
}

.in-band {
background-color: white;
}
Expand Down Expand Up @@ -83,6 +84,11 @@ pre {
}

:target { background: #FDFFD3; }

:target > .in-band {
background: #FDFFD3;
}

.content .highlighted {
color: #000 !important;
background-color: #ccc;
Expand Down