@@ -340,6 +340,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
340340 | clean:: EnumItem ( ..)
341341 | clean:: TypedefItem ( ..)
342342 | clean:: TraitItem ( ..)
343+ | clean:: TraitAliasItem ( ..)
343344 | clean:: FunctionItem ( ..)
344345 | clean:: ModuleItem ( ..)
345346 | clean:: ForeignFunctionItem ( ..)
@@ -350,26 +351,43 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
350351 | clean:: ForeignTypeItem
351352 | clean:: MacroItem ( ..)
352353 | clean:: ProcMacroItem ( ..)
353- | clean:: VariantItem ( ..)
354- if !self . cache . stripped_mod =>
355- {
356- // Re-exported items mean that the same id can show up twice
357- // in the rustdoc ast that we're looking at. We know,
358- // however, that a re-exported item doesn't show up in the
359- // `public_items` map, so we can skip inserting into the
360- // paths map if there was already an entry present and we're
361- // not a public item.
362- if !self . cache . paths . contains_key ( & item. def_id )
363- || self . cache . access_levels . is_public ( item. def_id )
364- {
365- self . cache . paths . insert ( item. def_id , ( self . cache . stack . clone ( ) , item. type_ ( ) ) ) ;
354+ | clean:: VariantItem ( ..) => {
355+ if !self . cache . stripped_mod {
356+ // Re-exported items mean that the same id can show up twice
357+ // in the rustdoc ast that we're looking at. We know,
358+ // however, that a re-exported item doesn't show up in the
359+ // `public_items` map, so we can skip inserting into the
360+ // paths map if there was already an entry present and we're
361+ // not a public item.
362+ if !self . cache . paths . contains_key ( & item. def_id )
363+ || self . cache . access_levels . is_public ( item. def_id )
364+ {
365+ self . cache
366+ . paths
367+ . insert ( item. def_id , ( self . cache . stack . clone ( ) , item. type_ ( ) ) ) ;
368+ }
366369 }
367370 }
368371 clean:: PrimitiveItem ( ..) => {
369372 self . cache . paths . insert ( item. def_id , ( self . cache . stack . clone ( ) , item. type_ ( ) ) ) ;
370373 }
371374
372- _ => { }
375+ clean:: ExternCrateItem { .. }
376+ | clean:: ImportItem ( ..)
377+ | clean:: OpaqueTyItem ( ..)
378+ | clean:: ImplItem ( ..)
379+ | clean:: TyMethodItem ( ..)
380+ | clean:: MethodItem ( ..)
381+ | clean:: StructFieldItem ( ..)
382+ | clean:: AssocConstItem ( ..)
383+ | clean:: AssocTypeItem ( ..)
384+ | clean:: StrippedItem ( ..)
385+ | clean:: KeywordItem ( ..) => {
386+ // FIXME: Do these need handling?
387+ // The person writing this comment doesn't know.
388+ // So would rather leave them to an expert,
389+ // as at least the list is better than `_ => {}`.
390+ }
373391 }
374392
375393 // Maintain the parent stack
0 commit comments