@@ -101,6 +101,7 @@ impl<'tcx> JsonRenderer<'tcx> {
101
101
}
102
102
103
103
fn get_trait_items ( & mut self ) -> Vec < ( types:: Id , types:: Item ) > {
104
+ debug ! ( "Adding foreign trait items" ) ;
104
105
Rc :: clone ( & self . cache )
105
106
. traits
106
107
. iter ( )
@@ -109,6 +110,7 @@ impl<'tcx> JsonRenderer<'tcx> {
109
110
if !id. is_local ( ) {
110
111
let trait_item = & trait_item. trait_ ;
111
112
for item in & trait_item. items {
113
+ trace ! ( "Adding subitem to {id:?}: {:?}" , item. item_id) ;
112
114
self . item ( item. clone ( ) ) . unwrap ( ) ;
113
115
}
114
116
let item_id = from_item_id ( id. into ( ) , self . tcx ) ;
@@ -184,7 +186,9 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
184
186
/// the hashmap because certain items (traits and types) need to have their mappings for trait
185
187
/// implementations filled out before they're inserted.
186
188
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) ;
188
192
189
193
// Flatten items that recursively store other items. We include orphaned items from
190
194
// stripped modules and etc that are otherwise reachable.
@@ -253,6 +257,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
253
257
}
254
258
}
255
259
260
+ trace ! ( "done rendering {} {:?}" , item_type, item_name) ;
256
261
Ok ( ( ) )
257
262
}
258
263
@@ -263,14 +268,20 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
263
268
fn after_krate ( & mut self ) -> Result < ( ) , Error > {
264
269
debug ! ( "Done with crate" ) ;
265
270
271
+ debug ! ( "Adding Primitve impls" ) ;
266
272
for primitive in Rc :: clone ( & self . cache ) . primitive_locations . values ( ) {
267
273
self . get_impls ( * primitive) ;
268
274
}
269
275
270
276
let e = ExternalCrate { crate_num : LOCAL_CRATE } ;
271
277
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 ( ) ;
272
281
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" ) ;
274
285
// This needs to be the default HashMap for compatibility with the public interface for
275
286
// rustdoc-json-types
276
287
#[ allow( rustc:: default_hash_types) ]
0 commit comments