Skip to content

Commit e83b366

Browse files
committed
Auto merge of #31596 - mitaa:rdoc_assoc_item, r=alexcrichton
2 parents deaf150 + 8cb2fae commit e83b366

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

clean/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,10 +1281,8 @@ impl Clean<Item> for hir::ImplItem {
12811281
fn clean(&self, cx: &DocContext) -> Item {
12821282
let inner = match self.node {
12831283
hir::ImplItemKind::Const(ref ty, ref expr) => {
1284-
ConstantItem(Constant{
1285-
type_: ty.clean(cx),
1286-
expr: expr.span.to_src(cx),
1287-
})
1284+
AssociatedConstItem(ty.clean(cx),
1285+
Some(expr.span.to_src(cx)))
12881286
}
12891287
hir::ImplItemKind::Method(ref sig, _) => {
12901288
MethodItem(sig.clean(cx))

html/render.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,25 +2550,25 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
25502550
}
25512551
}
25522552
clean::TypedefItem(ref tydef, _) => {
2553-
let id = derive_id(format!("assoc_type.{}", name));
2553+
let id = derive_id(format!("associatedtype.{}", name));
25542554
try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
25552555
try!(write!(w, "type {} = {}", name, tydef.type_));
25562556
try!(write!(w, "</code></h4>\n"));
25572557
}
25582558
clean::AssociatedConstItem(ref ty, ref default) => {
2559-
let id = derive_id(format!("assoc_const.{}", name));
2559+
let id = derive_id(format!("associatedconstant.{}", name));
25602560
try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
25612561
try!(assoc_const(w, item, ty, default.as_ref()));
25622562
try!(write!(w, "</code></h4>\n"));
25632563
}
25642564
clean::ConstantItem(ref c) => {
2565-
let id = derive_id(format!("assoc_const.{}", name));
2565+
let id = derive_id(format!("associatedconstant.{}", name));
25662566
try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
25672567
try!(assoc_const(w, item, &c.type_, Some(&c.expr)));
25682568
try!(write!(w, "</code></h4>\n"));
25692569
}
25702570
clean::AssociatedTypeItem(ref bounds, ref default) => {
2571-
let id = derive_id(format!("assoc_type.{}", name));
2571+
let id = derive_id(format!("associatedtype.{}", name));
25722572
try!(write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item)));
25732573
try!(assoc_type(w, item, bounds, default));
25742574
try!(write!(w, "</code></h4>\n"));

0 commit comments

Comments
 (0)