Skip to content

Commit a636398

Browse files
authored
Rollup merge of #102744 - notriddle:notriddle/content-item-list, r=GuillaumeGomez
rustdoc: remove unused CSS `.content .item-list` When these rules were added in 4fd061c (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag. In c1b1d68, it was changed to use a `<div>` tag, so these rules are both no-ops.
2 parents 047ff20 + 0997b28 commit a636398

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

src/librustdoc/html/render/print_item.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
890890
w,
891891
"implementors",
892892
"Implementors",
893-
"<div class=\"item-list\" id=\"implementors-list\">",
893+
"<div id=\"implementors-list\">",
894894
);
895895
for implementor in concrete {
896896
render_implementor(cx, implementor, it, w, &implementor_dups, &[]);
@@ -902,7 +902,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
902902
w,
903903
"synthetic-implementors",
904904
"Auto implementors",
905-
"<div class=\"item-list\" id=\"synthetic-implementors-list\">",
905+
"<div id=\"synthetic-implementors-list\">",
906906
);
907907
for implementor in synthetic {
908908
render_implementor(
@@ -923,15 +923,15 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
923923
w,
924924
"implementors",
925925
"Implementors",
926-
"<div class=\"item-list\" id=\"implementors-list\"></div>",
926+
"<div id=\"implementors-list\"></div>",
927927
);
928928

929929
if t.is_auto(cx.tcx()) {
930930
write_small_section_header(
931931
w,
932932
"synthetic-implementors",
933933
"Auto implementors",
934-
"<div class=\"item-list\" id=\"synthetic-implementors-list\"></div>",
934+
"<div id=\"synthetic-implementors-list\"></div>",
935935
);
936936
}
937937
}

src/librustdoc/html/static/css/rustdoc.css

-5
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,6 @@ pre, .rustdoc.source .example-wrap {
690690
border: 1px solid var(--border-color);
691691
}
692692

693-
.content .item-list {
694-
list-style-type: none;
695-
padding: 0;
696-
}
697-
698693
/* Shift "where ..." part of method or fn definition down a line */
699694
.content .method .where,
700695
.content .fn .where,

src/test/rustdoc/impl-disambiguation.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pub trait Foo {}
44

55
pub struct Bar<T> { field: T }
66

7-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
7+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
88
// "impl Foo for Bar<u8>"
99
impl Foo for Bar<u8> {}
10-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
10+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1111
// "impl Foo for Bar<u16>"
1212
impl Foo for Bar<u16> {}
13-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
13+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1414
// "impl<'a> Foo for &'a Bar<u8>"
1515
impl<'a> Foo for &'a Bar<u8> {}
1616

@@ -22,9 +22,9 @@ pub mod mod2 {
2222
pub enum Baz {}
2323
}
2424

25-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
25+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
2626
// "impl Foo for foo::mod1::Baz"
2727
impl Foo for mod1::Baz {}
28-
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
28+
// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
2929
// "impl<'a> Foo for &'a foo::mod2::Baz"
3030
impl<'a> Foo for &'a mod2::Baz {}

src/test/rustdoc/impl-parts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ pub struct Foo<T> { field: T }
77

88
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
99
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
10-
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header"]' \
10+
// @has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
1111
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
1212
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

0 commit comments

Comments
 (0)