@@ -101,6 +101,7 @@ impl<'tcx> JsonRenderer<'tcx> {
101101 }
102102
103103 fn get_trait_items ( & mut self ) -> Vec < ( types:: Id , types:: Item ) > {
104+ debug ! ( "Adding foreign trait items" ) ;
104105 Rc :: clone ( & self . cache )
105106 . traits
106107 . iter ( )
@@ -109,6 +110,7 @@ impl<'tcx> JsonRenderer<'tcx> {
109110 if !id. is_local ( ) {
110111 let trait_item = & trait_item. trait_ ;
111112 for item in & trait_item. items {
113+ trace ! ( "Adding subitem to {id:?}: {:?}" , item. item_id) ;
112114 self . item ( item. clone ( ) ) . unwrap ( ) ;
113115 }
114116 let item_id = from_item_id ( id. into ( ) , self . tcx ) ;
@@ -184,7 +186,9 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
184186 /// the hashmap because certain items (traits and types) need to have their mappings for trait
185187 /// implementations filled out before they're inserted.
186188 fn item ( & mut self , item : clean:: Item ) -> Result < ( ) , Error > {
187- trace ! ( "rendering {} {:?}" , item. type_( ) , item. name) ;
189+ let item_type = item. type_ ( ) ;
190+ let item_name = item. name ;
191+ trace ! ( "rendering {} {:?}" , item_type, item_name) ;
188192
189193 // Flatten items that recursively store other items. We include orphaned items from
190194 // stripped modules and etc that are otherwise reachable.
@@ -253,6 +257,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
253257 }
254258 }
255259
260+ trace ! ( "done rendering {} {:?}" , item_type, item_name) ;
256261 Ok ( ( ) )
257262 }
258263
@@ -263,14 +268,20 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
263268 fn after_krate ( & mut self ) -> Result < ( ) , Error > {
264269 debug ! ( "Done with crate" ) ;
265270
271+ debug ! ( "Adding Primitve impls" ) ;
266272 for primitive in Rc :: clone ( & self . cache ) . primitive_locations . values ( ) {
267273 self . get_impls ( * primitive) ;
268274 }
269275
270276 let e = ExternalCrate { crate_num : LOCAL_CRATE } ;
271277
278+ // FIXME(adotinthevoid): Remove this, as it's not consistant with not
279+ // inlining foreign items.
280+ let foreign_trait_items = self . get_trait_items ( ) ;
272281 let mut index = ( * self . index ) . clone ( ) . into_inner ( ) ;
273- index. extend ( self . get_trait_items ( ) ) ;
282+ index. extend ( foreign_trait_items) ;
283+
284+ debug ! ( "Constructing Output" ) ;
274285 // This needs to be the default HashMap for compatibility with the public interface for
275286 // rustdoc-json-types
276287 #[ allow( rustc:: default_hash_types) ]
0 commit comments