Skip to content

Commit 8cf995f

Browse files
Rollup merge of #87251 - GuillaumeGomez:item-info-width, r=notriddle
Fix "item info" width Fixes #87202. It now looks again like this: ![Screenshot from 2021-07-18 12-33-27](https://user-images.githubusercontent.com/3050060/126064005-013acabc-7f17-4436-8dfc-cb6b9bc24413.png) cc `@jyn514` r? `@notriddle`
2 parents 6df9df7 + 57f7501 commit 8cf995f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,9 @@ body.blur > :not(#help) {
925925
padding: 0 20px 20px 17px;;
926926
}
927927

928+
.item-info .stab {
929+
display: table;
930+
}
928931
.stab {
929932
border-width: 1px;
930933
border-style: solid;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This test ensures that the item information don't take 100% of the width if unnecessary.
2+
goto: file://|DOC_PATH|/lib2/struct.Foo.html
3+
// We set a fixed size so there is no chance of "random" resize.
4+
size: (1100, 800)
5+
// We check that ".item-info" is bigger than its content.
6+
assert-css: (".item-info", {"width": "807px"})
7+
assert-css: (".item-info .stab", {"width": "343px"})

src/test/rustdoc-gui/src/lib2/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// ignore-tidy-linelength
22

3+
#![feature(doc_cfg)]
4+
35
pub mod module {
46
pub mod sub_module {
57
pub mod sub_sub_module {
@@ -14,6 +16,7 @@ pub fn foobar() {}
1416

1517
pub type Alias = u32;
1618

19+
#[doc(cfg(feature = "foo-method"))]
1720
pub struct Foo {
1821
pub x: Alias,
1922
}

0 commit comments

Comments
 (0)