Skip to content

Commit 1c80a56

Browse files
committed
rustdoc: make struct fields display: block
1 parent e221616 commit 1c80a56

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,8 @@ a {
701701
}
702702

703703
.small-section-header {
704+
/* fields use <span> tags, but should get their own lines */
705+
display: block;
704706
position: relative;
705707
}
706708

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

+5
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ pub struct WithGenerics<T: TraitWithNoDocblocks, S = String, E = WhoLetTheDogOut
408408
p: P,
409409
}
410410

411+
pub struct StructWithPublicUndocumentedFields {
412+
pub first: u32,
413+
pub second: u32,
414+
}
415+
411416
pub const CONST: u8 = 0;
412417

413418
pub trait TraitWithoutGenerics {
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
goto: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html"
2+
3+
// Both fields must be on their own line. In other words, they have display: block.
4+
store-property: (first_top, "//*[@id='structfield.first']", "offsetTop")
5+
assert-property-false: ("//*[@id='structfield.second']", { "offsetTop": |first_top| })

0 commit comments

Comments
 (0)