diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-18 14:08:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-18 14:08:42 +0200 |
| commit | d151ed869999f92b8a192f898197e5ad3e47e438 (patch) | |
| tree | ee15c1be5c8fa122950515855c81aa2a87427700 /src/librustdoc/html/render/mod.rs | |
| parent | 07d11cf95c87e788c69783611a64bb2365d9447d (diff) | |
| parent | 6696a60f0f04e1b7e78927f5747c1080f5189370 (diff) | |
| download | rust-d151ed869999f92b8a192f898197e5ad3e47e438.tar.gz rust-d151ed869999f92b8a192f898197e5ad3e47e438.zip | |
Rollup merge of #85280 - jsha:move-trait-toggles, r=GuillaumeGomez
Toggle-wrap items differently than top-doc. This makes sure things like trait methods get wrapped at the `<h3><code>` level rather than at the `.docblock` level. Also it ensures that only the actual top documentation gets the `.top-doc` class. Fixes #85167 Before:  https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read After: 
Diffstat (limited to 'src/librustdoc/html/render/mod.rs')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b807c5ccc47..a288b43722a 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -509,7 +509,11 @@ fn document(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, parent: Option info!("Documenting {}", name); } document_item_info(w, cx, item, parent); - document_full_collapsible(w, item, cx); + if parent.is_none() { + document_full_collapsible(w, item, cx); + } else { + document_full(w, item, cx); + } } /// Render md_text as markdown. |
