Skip to content

Commit dd315fd

Browse files
authored
Rollup merge of #107432 - notriddle:notriddle/has-srclink, r=GuillaumeGomez
rustdoc: remove unused class `has-srclink` Stopped being used in CSS with 73d0f7c.
2 parents 3922654 + 74e843c commit dd315fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+96
-108
lines changed

src/librustdoc/html/render/mod.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,11 +1528,7 @@ fn render_impl(
15281528
})
15291529
})
15301530
.map(|item| format!("{}.{}", item.type_(), name));
1531-
write!(
1532-
w,
1533-
"<section id=\"{}\" class=\"{}{} has-srclink\">",
1534-
id, item_type, in_trait_class,
1535-
);
1531+
write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class,);
15361532
render_rightside(w, cx, item, containing_item, render_mode);
15371533
if trait_.is_some() {
15381534
// Anchors are only used on trait impls.
@@ -1554,11 +1550,7 @@ fn render_impl(
15541550
kind @ (clean::TyAssocConstItem(ty) | clean::AssocConstItem(ty, _)) => {
15551551
let source_id = format!("{}.{}", item_type, name);
15561552
let id = cx.derive_id(source_id.clone());
1557-
write!(
1558-
w,
1559-
"<section id=\"{}\" class=\"{}{} has-srclink\">",
1560-
id, item_type, in_trait_class
1561-
);
1553+
write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class);
15621554
render_rightside(w, cx, item, containing_item, render_mode);
15631555
if trait_.is_some() {
15641556
// Anchors are only used on trait impls.
@@ -1606,11 +1598,7 @@ fn render_impl(
16061598
clean::AssocTypeItem(tydef, _bounds) => {
16071599
let source_id = format!("{}.{}", item_type, name);
16081600
let id = cx.derive_id(source_id.clone());
1609-
write!(
1610-
w,
1611-
"<section id=\"{}\" class=\"{}{} has-srclink\">",
1612-
id, item_type, in_trait_class
1613-
);
1601+
write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class);
16141602
if trait_.is_some() {
16151603
// Anchors are only used on trait impls.
16161604
write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
@@ -1844,7 +1832,7 @@ pub(crate) fn render_impl_summary(
18441832
} else {
18451833
format!(" data-aliases=\"{}\"", aliases.join(","))
18461834
};
1847-
write!(w, "<section id=\"{}\" class=\"impl has-srclink\"{}>", id, aliases);
1835+
write!(w, "<section id=\"{}\" class=\"impl\"{}>", id, aliases);
18481836
render_rightside(w, cx, &i.impl_item, containing_item, RenderMode::Normal);
18491837
write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
18501838
write!(w, "<h3 class=\"code-header\">");

src/librustdoc/html/render/print_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
735735
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
736736
write!(w, "<details class=\"toggle{method_toggle_class}\" open><summary>");
737737
}
738-
write!(w, "<section id=\"{}\" class=\"method has-srclink\">", id);
738+
write!(w, "<section id=\"{}\" class=\"method\">", id);
739739
render_rightside(w, cx, m, t, RenderMode::Normal);
740740
write!(w, "<h4 class=\"code-header\">");
741741
render_assoc_item(

tests/rustdoc-gui/src-font-size.goml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
55
show-text: true
66
// Check the impl headers.
7-
assert-css: (".impl.has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
8-
assert-css: (".impl.has-srclink .code-header", {"font-size": "18px", "font-weight": 600}, ALL)
7+
assert-css: (".impl .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
8+
assert-css: (".impl .code-header", {"font-size": "18px", "font-weight": 600}, ALL)
99
// Check the impl items.
10-
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
11-
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px", "font-weight": 600}, ALL)
10+
assert-css: (".impl-items .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
11+
assert-css: (".impl-items .code-header", {"font-size": "16px", "font-weight": 600}, ALL)
1212

1313
// Check that we can click on source link
1414
store-document-property: (url, "URL")
15-
click: ".impl-items .has-srclink .srclink"
15+
click: ".impl-items .srclink"
1616
assert-document-property-false: {"URL": |url|}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="associatedconstant.YOLO" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#16">source</a><h4 class="code-header">const <a href="#associatedconstant.YOLO" class="constant">YOLO</a>: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section>
1+
<section id="associatedconstant.YOLO" class="method"><a class="srclink rightside" href="../src/foo/anchors.rs.html#16">source</a><h4 class="code-header">const <a href="#associatedconstant.YOLO" class="constant">YOLO</a>: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="associatedconstant.X" class="associatedconstant has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#42">source</a><h4 class="code-header">pub const <a href="#associatedconstant.X" class="constant">X</a>: <a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a> = 0i32</h4></section>
1+
<section id="associatedconstant.X" class="associatedconstant"><a class="srclink rightside" href="../src/foo/anchors.rs.html#42">source</a><h4 class="code-header">pub const <a href="#associatedconstant.X" class="constant">X</a>: <a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a> = 0i32</h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#48">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -&gt; Self</h4></section>
1+
<section id="method.new" class="method"><a class="srclink rightside" href="../src/foo/anchors.rs.html#48">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -&gt; Self</h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="method.bar" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#23">source</a><h4 class="code-header">fn <a href="#method.bar" class="fn">bar</a>()</h4></section>
1+
<section id="method.bar" class="method"><a class="srclink rightside" href="../src/foo/anchors.rs.html#23">source</a><h4 class="code-header">fn <a href="#method.bar" class="fn">bar</a>()</h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="tymethod.foo" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#20">source</a><h4 class="code-header">fn <a href="#tymethod.foo" class="fn">foo</a>()</h4></section>
1+
<section id="tymethod.foo" class="method"><a class="srclink rightside" href="../src/foo/anchors.rs.html#20">source</a><h4 class="code-header">fn <a href="#tymethod.foo" class="fn">foo</a>()</h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="associatedtype.T" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#13">source</a><h4 class="code-header">type <a href="#associatedtype.T" class="associatedtype">T</a></h4></section>
1+
<section id="associatedtype.T" class="method"><a class="srclink rightside" href="../src/foo/anchors.rs.html#13">source</a><h4 class="code-header">type <a href="#associatedtype.T" class="associatedtype">T</a></h4></section>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<section id="associatedtype.Y" class="associatedtype has-srclink"><h4 class="code-header">type <a href="#associatedtype.Y" class="associatedtype">Y</a> = <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section>
1+
<section id="associatedtype.Y" class="associatedtype"><h4 class="code-header">type <a href="#associatedtype.Y" class="associatedtype">Y</a> = <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section>

0 commit comments

Comments
 (0)