diff options
| author | bors <bors@rust-lang.org> | 2022-09-13 21:05:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-13 21:05:21 +0000 |
| commit | 17cbdfd07178349d0a3cecb8e7dde8f915666ced (patch) | |
| tree | c873d712775ce17d869b73d02f2eecc649519c78 /src/librustdoc | |
| parent | c84083b08e2db69fcf270c4045837fa02663a3bf (diff) | |
| parent | f04eee11578b31b0618e854873c21ce5c453f52c (diff) | |
| download | rust-17cbdfd07178349d0a3cecb8e7dde8f915666ced.tar.gz rust-17cbdfd07178349d0a3cecb8e7dde8f915666ced.zip | |
Auto merge of #101777 - matthiaskrgr:rollup-x2dyaa2, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #101266 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Final) - #101737 (rustdoc: remove no-op CSS `.search-results .result-name > span`) - #101752 (Improve Attribute doc methods) - #101754 (Fix doc of log function) - #101759 (:arrow_up: rust-analyzer) - #101765 (Add documentation for TyCtxt::visibility) - #101770 (Rustdoc-Json: Don't loose subitems of foreign traits.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 6 | ||||
| -rw-r--r-- | src/librustdoc/json/mod.rs | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 011c559b34b..600e7cf3a0b 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -986,12 +986,6 @@ so that we can apply CSS-filters to change the arrow color in themes */ padding-right: 1em; } -.search-results .result-name > span { - display: inline-block; - margin: 0; - font-weight: normal; -} - .popover { font-size: 1rem; position: absolute; diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index 6a1409c7394..5e8f5f6fe3e 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -101,6 +101,7 @@ impl<'tcx> JsonRenderer<'tcx> { } fn get_trait_items(&mut self) -> Vec<(types::Id, types::Item)> { + debug!("Adding foreign trait items"); Rc::clone(&self.cache) .traits .iter() @@ -109,6 +110,7 @@ impl<'tcx> JsonRenderer<'tcx> { if !id.is_local() { let trait_item = &trait_item.trait_; for item in &trait_item.items { + trace!("Adding subitem to {id:?}: {:?}", item.item_id); self.item(item.clone()).unwrap(); } let item_id = from_item_id(id.into(), self.tcx); @@ -184,7 +186,9 @@ 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); + let item_type = item.type_(); + let item_name = item.name; + 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. @@ -253,6 +257,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { } } + trace!("done rendering {} {:?}", item_type, item_name); Ok(()) } @@ -263,14 +268,20 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { fn after_krate(&mut self) -> Result<(), Error> { debug!("Done with crate"); + debug!("Adding Primitve impls"); for primitive in Rc::clone(&self.cache).primitive_locations.values() { self.get_impls(*primitive); } let e = ExternalCrate { crate_num: LOCAL_CRATE }; + // FIXME(adotinthevoid): Remove this, as it's not consistant with not + // inlining foreign items. + let foreign_trait_items = self.get_trait_items(); let mut index = (*self.index).clone().into_inner(); - index.extend(self.get_trait_items()); + index.extend(foreign_trait_items); + + debug!("Constructing Output"); // This needs to be the default HashMap for compatibility with the public interface for // rustdoc-json-types #[allow(rustc::default_hash_types)] |
