diff options
| author | bors <bors@rust-lang.org> | 2022-07-16 20:31:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-16 20:31:42 +0000 |
| commit | d5e7f4782e4b699728d0a08200ecd1a54d56a85d (patch) | |
| tree | 2ecfa500407be289cf19a91c39d2ce7bdd511731 /src/librustdoc/json/mod.rs | |
| parent | 7210e46dc69a4b197a313d093fe145722c248b7d (diff) | |
| parent | 6277ac2fb8bf97cd910a0a841c6924b246d32c44 (diff) | |
| download | rust-d5e7f4782e4b699728d0a08200ecd1a54d56a85d.tar.gz rust-d5e7f4782e4b699728d0a08200ecd1a54d56a85d.zip | |
Auto merge of #99346 - matthiaskrgr:rollup-p4dl1qt, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #98582 (Allow destructuring opaque types in their defining scopes) - #99213 (migrate some of `rustc_passes::check_attr`'s diagnostics and derive improvements) - #99258 (Provide structured suggestion for dropped temp value) - #99259 (interpret/visitor: support visiting with a PlaceTy) - #99287 ([rustdoc-json] JSON no longer inlines) - #99290 (Revert "Highlight conflicting param-env candidates") - #99316 (docs: add missing word) - #99317 (Borrow Vec<T, A> as [T]) - #99323 (Fix flakyness of GUI tests) - #99342 (Avoid some `Symbol` to `String` conversions) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/json/mod.rs')
| -rw-r--r-- | src/librustdoc/json/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index c7251b51152..6364d00d062 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -21,6 +21,7 @@ use rustc_span::def_id::LOCAL_CRATE; use rustdoc_json_types as types; use crate::clean::types::{ExternalCrate, ExternalLocation}; +use crate::clean::ItemKind; use crate::config::RenderOptions; use crate::docfs::PathError; use crate::error::Error; @@ -175,6 +176,14 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { /// the hashmap because certain items (traits and types) need to have their mappings for trait /// implementations filled out before they're inserted. fn item(&mut self, item: clean::Item) -> Result<(), Error> { + trace!("rendering {} {:?}", item.type_(), item.name); + + // Flatten items that recursively store other items. We include orphaned items from + // stripped modules and etc that are otherwise reachable. + if let ItemKind::StrippedItem(inner) = &*item.kind { + inner.inner_items().for_each(|i| self.item(i.clone()).unwrap()); + } + // Flatten items that recursively store other items item.kind.inner_items().for_each(|i| self.item(i.clone()).unwrap()); |
