Skip to content

Commit 1f2dbb8

Browse files
committed
---
yaml --- r: 273722 b: refs/heads/beta c: 1bd8183 h: refs/heads/master
1 parent 871ec1b commit 1f2dbb8

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 3e33ef4c42c5e4c4400a8cd470ac851a4dff0789
26+
refs/heads/beta: 1bd8183c1581bffb688e07113bd2a7ee494bf2fb
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustdoc/html/render.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,8 +2160,9 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
21602160
write!(w, "<h2 class='fields'>Fields</h2>\n<table>")?;
21612161
for field in fields {
21622162
write!(w, "<tr class='stab {stab}'>
2163-
<td id='structfield.{name}'>\
2163+
<td id='{shortty}.{name}'>\
21642164
<code>{name}</code></td><td>",
2165+
shortty = ItemType::StructField,
21652166
stab = field.stability_class(),
21662167
name = field.name.as_ref().unwrap())?;
21672168
document(w, cx, field)?;
@@ -2231,7 +2232,8 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22312232
if !e.variants.is_empty() {
22322233
write!(w, "<h2 class='variants'>Variants</h2>\n<table class='variants_table'>")?;
22332234
for variant in &e.variants {
2234-
write!(w, "<tr><td id='variant.{name}'><code>{name}</code></td><td>",
2235+
write!(w, "<tr><td id='{shortty}.{name}'><code>{name}</code></td><td>",
2236+
shortty = ItemType::Variant,
22352237
name = variant.name.as_ref().unwrap())?;
22362238
document(w, cx, variant)?;
22372239

@@ -2247,8 +2249,9 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22472249
<table>")?;
22482250
for field in fields {
22492251
write!(w, "<tr><td \
2250-
id='variant.{v}.field.{f}'>\
2252+
id='{shortty}.{v}.field.{f}'>\
22512253
<code>{f}</code></td><td>",
2254+
shortty = ItemType::Variant,
22522255
v = variant.name.as_ref().unwrap(),
22532256
f = field.name.as_ref().unwrap())?;
22542257
document(w, cx, field)?;
@@ -2460,6 +2463,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
24602463
fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item,
24612464
link: AssocItemLink, render_static: bool,
24622465
outer_version: Option<&str>) -> fmt::Result {
2466+
let shortty = shortty(item);
24632467
let name = item.name.as_ref().unwrap();
24642468

24652469
let is_static = match item.inner {
@@ -2472,35 +2476,35 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
24722476
clean::MethodItem(..) | clean::TyMethodItem(..) => {
24732477
// Only render when the method is not static or we allow static methods
24742478
if !is_static || render_static {
2475-
let id = derive_id(format!("method.{}", name));
2476-
write!(w, "<h4 id='{}' class='{}'>", id, shortty(item))?;
2479+
let id = derive_id(format!("{}.{}", shortty, name));
2480+
write!(w, "<h4 id='{}' class='{}'>", id, shortty)?;
24772481
render_stability_since_raw(w, item.stable_since(), outer_version)?;
24782482
write!(w, "<code>")?;
24792483
render_assoc_item(w, item, link)?;
24802484
write!(w, "</code></h4>\n")?;
24812485
}
24822486
}
24832487
clean::TypedefItem(ref tydef, _) => {
2484-
let id = derive_id(format!("associatedtype.{}", name));
2485-
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item))?;
2488+
let id = derive_id(format!("{}.{}", ItemType::AssociatedType, name));
2489+
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty)?;
24862490
write!(w, "type {} = {}", name, tydef.type_)?;
24872491
write!(w, "</code></h4>\n")?;
24882492
}
24892493
clean::AssociatedConstItem(ref ty, ref default) => {
2490-
let id = derive_id(format!("associatedconstant.{}", name));
2491-
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item))?;
2494+
let id = derive_id(format!("{}.{}", shortty, name));
2495+
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty)?;
24922496
assoc_const(w, item, ty, default.as_ref())?;
24932497
write!(w, "</code></h4>\n")?;
24942498
}
24952499
clean::ConstantItem(ref c) => {
2496-
let id = derive_id(format!("associatedconstant.{}", name));
2497-
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item))?;
2500+
let id = derive_id(format!("{}.{}", shortty, name));
2501+
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty)?;
24982502
assoc_const(w, item, &c.type_, Some(&c.expr))?;
24992503
write!(w, "</code></h4>\n")?;
25002504
}
25012505
clean::AssociatedTypeItem(ref bounds, ref default) => {
2502-
let id = derive_id(format!("associatedtype.{}", name));
2503-
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty(item))?;
2506+
let id = derive_id(format!("{}.{}", shortty, name));
2507+
write!(w, "<h4 id='{}' class='{}'><code>", id, shortty)?;
25042508
assoc_type(w, item, bounds, default)?;
25052509
write!(w, "</code></h4>\n")?;
25062510
}

0 commit comments

Comments
 (0)