Auto merge of #35667 - ollie27:rustdoc_opaque_structs, r=steveklabnik
rustdoc: Don't add extra newlines for fully opaque structs
Changes the definition for braced structs with only private or hidden fields to save space on the page.
Before:
```
pub struct Vec<T> {
// some fields omitted
}
```
After:
```
pub struct Vec<T> { /* fields omitted */ }
```
This also cleans up empty braced structs.
Before:
```
pub struct Foo {
}
```
After:
```
pub struct Foo {}
```
[before](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html) [after](https://ollie27.github.io/rust_doc_test/std/vec/struct.Vec.html)
cc #34713
This commit is contained in:
commit
97b561a094
2 changed files with 25 additions and 6 deletions
|
|
@ -48,3 +48,13 @@ pub enum Qux {
|
|||
// @has - //pre "// some fields omitted"
|
||||
},
|
||||
}
|
||||
|
||||
// @has structfields/struct.Baz.html //pre "pub struct Baz { /* fields omitted */ }"
|
||||
pub struct Baz {
|
||||
x: u8,
|
||||
#[doc(hidden)]
|
||||
pub y: u8,
|
||||
}
|
||||
|
||||
// @has structfields/struct.Quux.html //pre "pub struct Quux {}"
|
||||
pub struct Quux {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue