Skip to content

Commit 1507902

Browse files
committed
---
yaml --- r: 275374 b: refs/heads/master c: ec5e0f8 h: refs/heads/master
1 parent 2ab1bfd commit 1507902

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d95ca2822cdc67ddec96d16533e23a10d6bfd136
2+
refs/heads/master: ec5e0f81cf54ca287e6652923e1bf46f4fc1c783
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
44
refs/heads/try: 49312a405e14a449b98fe0056b12a40ac128be4a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustdoc/html/render.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
24892489
}
24902490

24912491
fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item,
2492-
link: AssocItemLink, render_static: bool,
2492+
link: AssocItemLink, render_static: bool, is_default_item: bool,
24932493
outer_version: Option<&str>) -> fmt::Result {
24942494
let shortty = shortty(item);
24952495
let name = item.name.as_ref().unwrap();
@@ -2540,7 +2540,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25402540
_ => panic!("can't make docs for trait item with name {:?}", item.name)
25412541
}
25422542

2543-
if !is_static || render_static {
2543+
if !is_default_item && (!is_static || render_static) {
25442544
document(w, cx, item)
25452545
} else {
25462546
Ok(())
@@ -2549,7 +2549,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25492549

25502550
write!(w, "<div class='impl-items'>")?;
25512551
for trait_item in &i.impl_.items {
2552-
doctraititem(w, cx, trait_item, link, render_header, outer_version)?;
2552+
doctraititem(w, cx, trait_item, link, render_header, false, outer_version)?;
25532553
}
25542554

25552555
fn render_default_items(w: &mut fmt::Formatter,
@@ -2566,7 +2566,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25662566
let did = i.trait_.as_ref().unwrap().def_id().unwrap();
25672567
let assoc_link = AssocItemLink::GotoSource(did, &i.provided_trait_methods);
25682568

2569-
doctraititem(w, cx, trait_item, assoc_link, render_static,
2569+
doctraititem(w, cx, trait_item, assoc_link, render_static, true,
25702570
outer_version)?;
25712571
}
25722572
Ok(())

trunk/src/test/rustdoc/manual_impl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// @has manual_impl/trait.T.html
12+
// @has - '//*[@class="docblock"]' 'Docs associated with the trait definition.'
13+
// @has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
14+
// @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.'
1115
/// Docs associated with the trait definition.
1216
pub trait T {
1317
/// Docs associated with the trait a_method definition.

0 commit comments

Comments
 (0)