Skip to content

Commit 9b7279d

Browse files
authored
Rollup merge of rust-lang#64175 - GuillaumeGomez:replace-span-when-it-should-be-div, r=Mark-Simulacrum
Fix invalid span generation when it should be div Fixes rust-lang#64146. It changes basically nothing in the display... Can be checked with: ```rust pub enum X { /// Some doc? /// /// with lines! Foo { /// a /// /// b x: u32, /// Doc! /// /// ``` /// yolo /// ``` y: String, }, /// Doc! /// /// ``` /// yolo /// ``` Bar(String), } ``` r? @Mark-Simulacrum
2 parents 3134487 + d4d5aa4 commit 9b7279d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustdoc/html/render.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ fn item_enum(w: &mut fmt::Formatter<'_>, cx: &Context, it: &clean::Item,
35543554
let ns_id = cx.derive_id(format!("{}.{}",
35553555
variant.name.as_ref().unwrap(),
35563556
ItemType::Variant.name_space()));
3557-
write!(w, "<span id=\"{id}\" class=\"variant small-section-header\">\
3557+
write!(w, "<div id=\"{id}\" class=\"variant small-section-header\">\
35583558
<a href=\"#{id}\" class=\"anchor field\"></a>\
35593559
<code id='{ns_id}'>{name}",
35603560
id = id,
@@ -3572,7 +3572,7 @@ fn item_enum(w: &mut fmt::Formatter<'_>, cx: &Context, it: &clean::Item,
35723572
write!(w, ")")?;
35733573
}
35743574
}
3575-
write!(w, "</code></span>")?;
3575+
write!(w, "</code></div>")?;
35763576
document(w, cx, variant)?;
35773577
document_non_exhaustive(w, variant)?;
35783578

@@ -3583,7 +3583,7 @@ fn item_enum(w: &mut fmt::Formatter<'_>, cx: &Context, it: &clean::Item,
35833583
let variant_id = cx.derive_id(format!("{}.{}.fields",
35843584
ItemType::Variant,
35853585
variant.name.as_ref().unwrap()));
3586-
write!(w, "<span class='autohide sub-variant' id='{id}'>",
3586+
write!(w, "<div class='autohide sub-variant' id='{id}'>",
35873587
id = variant_id)?;
35883588
write!(w, "<h3>Fields of <b>{name}</b></h3><div>",
35893589
name = variant.name.as_ref().unwrap())?;
@@ -3609,7 +3609,7 @@ fn item_enum(w: &mut fmt::Formatter<'_>, cx: &Context, it: &clean::Item,
36093609
document(w, cx, field)?;
36103610
}
36113611
}
3612-
write!(w, "</div></span>")?;
3612+
write!(w, "</div></div>")?;
36133613
}
36143614
render_stability_since(w, variant, it)?;
36153615
}

0 commit comments

Comments
 (0)