Rollup merge of #104744 - notriddle:notriddle/struct-fields-display-block, r=GuillaumeGomez

rustdoc: give struct fields CSS `display: block`

Fixes #104737
This commit is contained in:
Dylan DPC 2022-11-23 20:32:37 +05:30 committed by GitHub
commit a39ed5c3f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -701,6 +701,8 @@ a {
}
.small-section-header {
/* fields use <span> tags, but should get their own lines */
display: block;
position: relative;
}

View File

@ -408,6 +408,11 @@ pub struct WithGenerics<T: TraitWithNoDocblocks, S = String, E = WhoLetTheDogOut
p: P,
}
pub struct StructWithPublicUndocumentedFields {
pub first: u32,
pub second: u32,
}
pub const CONST: u8 = 0;
pub trait TraitWithoutGenerics {

View File

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