@@ -43,7 +43,7 @@ impl JsonRenderer<'_> {
43
43
let span = item. span ( self . tcx ) ;
44
44
let clean:: Item { name, attrs : _, kind : _, visibility, item_id, cfg : _ } = item;
45
45
let inner = match * item. kind {
46
- clean:: StrippedItem ( _) => return None ,
46
+ clean:: StrippedItem ( _) | clean :: KeywordItem ( _ ) => return None ,
47
47
_ => from_clean_item ( item, self . tcx ) ,
48
48
} ;
49
49
Some ( Item {
@@ -254,11 +254,8 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
254
254
} ,
255
255
// FIXME: do not map to Typedef but to a custom variant
256
256
AssocTypeItem ( t, _) => ItemEnum :: Typedef ( t. into_tcx ( tcx) ) ,
257
- // `convert_item` early returns `None` for striped items
258
- StrippedItem ( _) => unreachable ! ( ) ,
259
- KeywordItem ( _) => {
260
- panic ! ( "{:?} is not supported for JSON output" , item)
261
- }
257
+ // `convert_item` early returns `None` for striped items and keywords.
258
+ StrippedItem ( _) | KeywordItem ( _) => unreachable ! ( ) ,
262
259
ExternCrateItem { ref src } => ItemEnum :: ExternCrate {
263
260
name : name. as_ref ( ) . unwrap ( ) . to_string ( ) ,
264
261
rename : src. map ( |x| x. to_string ( ) ) ,
@@ -764,7 +761,7 @@ impl FromWithTcx<ItemType> for ItemKind {
764
761
fn ids ( items : impl IntoIterator < Item = clean:: Item > , tcx : TyCtxt < ' _ > ) -> Vec < Id > {
765
762
items
766
763
. into_iter ( )
767
- . filter ( |x| !x. is_stripped ( ) )
764
+ . filter ( |x| !x. is_stripped ( ) && !x . is_keyword ( ) )
768
765
. map ( |i| from_item_id_with_name ( i. item_id , tcx, i. name ) )
769
766
. collect ( )
770
767
}
0 commit comments