Skip to content

Commit 97f8189

Browse files
committed
rustdoc: remove mostly-unused CSS classes import/module-item
1 parent c62665e commit 97f8189

14 files changed

+26
-27
lines changed

src/librustdoc/html/render/print_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
391391
};
392392
write!(
393393
w,
394-
"<div class=\"item-left {stab}{add}import-item\"{id}>\
394+
"<div class=\"item-left{add}{stab}\"{id}>\
395395
<code>{vis}{imp}</code>\
396396
</div>\
397397
{stab_tags_before}{stab_tags}{stab_tags_after}",
@@ -437,7 +437,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
437437
};
438438
write!(
439439
w,
440-
"<div class=\"item-left {stab}{add}module-item\">\
440+
"<div class=\"item-left{add}{stab}\">\
441441
<a class=\"{class}\" href=\"{href}\" title=\"{title}\">{name}</a>\
442442
{visibility_emoji}\
443443
{unsafety_flag}\

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
977977
0 -1px 0 black;
978978
}
979979

980-
.module-item.unstable,
981-
.import-item.unstable {
980+
.item-left.unstable {
982981
opacity: 0.65;
983982
}
984983

tests/rustdoc-gui/label-next-to-symbol.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assert-css: (
2020
// table like view
2121
assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
2222
compare-elements-position-near: (
23-
"//*[@class='item-left module-item']//a[text()='replaced_function']",
23+
"//*[@class='item-left']//a[text()='replaced_function']",
2424
".item-left .stab.deprecated",
2525
{"y": 2},
2626
)
@@ -32,7 +32,7 @@ compare-elements-position: (
3232

3333
// Ensure no wrap
3434
compare-elements-position: (
35-
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
35+
"//*[@class='item-left']//a[text()='replaced_function']/..",
3636
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
3737
("y"),
3838
)
@@ -43,7 +43,7 @@ size: (600, 600)
4343
// staggered layout with 2em spacing
4444
assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
4545
compare-elements-position-near: (
46-
"//*[@class='item-left module-item']//a[text()='replaced_function']",
46+
"//*[@class='item-left']//a[text()='replaced_function']",
4747
".item-left .stab.deprecated",
4848
{"y": 2},
4949
)
@@ -55,7 +55,7 @@ compare-elements-position: (
5555

5656
// Ensure wrap
5757
compare-elements-position-false: (
58-
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
58+
"//*[@class='item-left']//a[text()='replaced_function']/..",
5959
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
6060
("y"),
6161
)

tests/rustdoc-gui/module-items-font.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks that the correct font is used on module items (in index.html pages).
22
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
33
assert-css: (
4-
".item-table .module-item a",
4+
".item-table .item-left > a",
55
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
66
ALL,
77
)

tests/rustdoc/cfg_doc_reexport.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#![no_core]
66

77
// @has 'foo/index.html'
8-
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
9-
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
8+
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'foobar'
9+
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'bar'
1010

1111
#[doc(cfg(feature = "foobar"))]
1212
mod imp_priv {

tests/rustdoc/deprecated.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @has deprecated/index.html '//*[@class="item-left module-item"]/span[@class="stab deprecated"]' \
1+
// @has deprecated/index.html '//*[@class="item-left"]/span[@class="stab deprecated"]' \
22
// 'Deprecated'
33
// @has - '//*[@class="item-right docblock-short"]' 'Deprecated docs'
44

tests/rustdoc/doc-cfg.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Portable;
1212
// @has doc_cfg/unix_only/index.html \
1313
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
1414
// 'Available on Unix only.'
15-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AARM\Z'
15+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AARM\Z'
1616
// @count - '//*[@class="stab portability"]' 2
1717
#[doc(cfg(unix))]
1818
pub mod unix_only {
@@ -42,7 +42,7 @@ pub mod unix_only {
4242
// @has doc_cfg/wasi_only/index.html \
4343
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
4444
// 'Available on WASI only.'
45-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AWebAssembly\Z'
45+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AWebAssembly\Z'
4646
// @count - '//*[@class="stab portability"]' 2
4747
#[doc(cfg(target_os = "wasi"))]
4848
pub mod wasi_only {
@@ -74,7 +74,7 @@ pub mod wasi_only {
7474

7575
// the portability header is different on the module view versus the full view
7676
// @has doc_cfg/index.html
77-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\Aavx\Z'
77+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\Aavx\Z'
7878

7979
// @has doc_cfg/fn.uses_target_feature.html
8080
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \

tests/rustdoc/duplicate-cfg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![feature(doc_cfg)]
33

44
// @has 'foo/index.html'
5-
// @matches '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]' '^sync$'
6-
// @has '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
5+
// @matches '-' '//*[@class="item-left"]//*[@class="stab portability"]' '^sync$'
6+
// @has '-' '//*[@class="item-left"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
77

88
// @has 'foo/struct.Foo.html'
99
// @has '-' '//*[@class="stab portability"]' 'sync'

tests/rustdoc/glob-shadowing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @has 'glob_shadowing/index.html'
2-
// @count - '//div[@class="item-left module-item"]' 6
2+
// @count - '//div[@class="item-left"]' 6
33
// @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe'
44
// @has - '//div[@class="item-right docblock-short"]' 'sub2::describe'
55

tests/rustdoc/inline_cross/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
extern crate macros;
88

9-
// @has foo/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
9+
// @has foo/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
1010
// Deprecated
11-
// @has - '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
11+
// @has - '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
1212
// Experimental
1313

1414
// @has foo/macro.my_macro.html

tests/rustdoc/issue-32374.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#![doc(issue_tracker_base_url = "https://issue_url/")]
33
#![unstable(feature = "test", issue = "32374")]
44

5-
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
5+
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
66
// 'Deprecated'
7-
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
7+
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
88
// 'Experimental'
99
// @matches issue_32374/index.html '//*[@class="item-right docblock-short"]/text()' 'Docs'
1010

tests/rustdoc/issue-55364.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pub mod subone {
2929
// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo'
3030
// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar'
3131
// Though there should be such links later
32-
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.foo.html"]' 'foo'
33-
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.bar.html"]' 'bar'
32+
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left"]/a[@class="fn"][@href="fn.foo.html"]' 'foo'
33+
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left"]/a[@class="fn"][@href="fn.bar.html"]' 'bar'
3434
/// See either [foo] or [bar].
3535
pub mod subtwo {
3636

tests/rustdoc/issue-95873.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// @has issue_95873/index.html "//*[@class='item-left import-item']" "pub use ::std as x;"
1+
// @has issue_95873/index.html "//*[@class='item-left']" "pub use ::std as x;"
22
pub use ::std as x;

tests/rustdoc/reexport-check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
extern crate reexport_check;
55

66
// @!has 'foo/index.html' '//code' 'pub use self::i32;'
7-
// @has 'foo/index.html' '//div[@class="item-left deprecated module-item"]' 'i32'
7+
// @has 'foo/index.html' '//div[@class="item-left deprecated"]' 'i32'
88
// @has 'foo/i32/index.html'
99
#[allow(deprecated, deprecated_in_future)]
1010
pub use std::i32;
1111
// @!has 'foo/index.html' '//code' 'pub use self::string::String;'
12-
// @has 'foo/index.html' '//div[@class="item-left module-item"]' 'String'
12+
// @has 'foo/index.html' '//div[@class="item-left"]' 'String'
1313
pub use std::string::String;
1414

1515
// @has 'foo/index.html' '//div[@class="item-right docblock-short"]' 'Docs in original'

0 commit comments

Comments
 (0)