Skip to content

Commit eb3c3e3

Browse files
Handle reexports items list a bit differently since they cannot have documentation
1 parent 0d78bd3 commit eb3c3e3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/librustdoc/html/render/print_item.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ macro_rules! item_template_methods {
141141
}
142142

143143
const ITEM_TABLE_OPEN: &str = "<dl class=\"item-table\">";
144+
const REEXPORTS_TABLE_OPEN: &str = "<dl class=\"item-table reexports\">";
144145
const ITEM_TABLE_CLOSE: &str = "</dl>";
145146

146147
// A component in a `use` path, like `string` in std::string::ToString
@@ -398,13 +399,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
398399
w.write_str(ITEM_TABLE_CLOSE);
399400
}
400401
last_section = Some(my_section);
401-
write_section_heading(
402-
w,
403-
my_section.name(),
404-
&cx.derive_id(my_section.id()),
405-
None,
406-
ITEM_TABLE_OPEN,
407-
);
402+
let section_id = my_section.id();
403+
let tag =
404+
if section_id == "reexports" { REEXPORTS_TABLE_OPEN } else { ITEM_TABLE_OPEN };
405+
write_section_heading(w, my_section.name(), &cx.derive_id(section_id), None, tag);
408406
}
409407

410408
match myitem.kind {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ in src-script.js and main.js
25432543
}
25442544

25452545
/* Since the screen is wide enough, we show items on their description on the same line. */
2546-
.item-table {
2546+
.item-table:not(.reexports) {
25472547
display: grid;
25482548
grid-template-columns: 33% 67%;
25492549
}

0 commit comments

Comments
 (0)