@@ -9,10 +9,10 @@ use rustc_data_structures::fx::FxHashMap;
99use rustc_hir:: def:: DefKind ;
1010use rustc_hir:: def_id:: DefId ;
1111use rustc_span:: { Symbol , sym} ;
12- use rustdoc_json_types:: { self as types, Id } ; // FIXME: Consistant.
12+ use rustdoc_json_types as types;
1313
1414use super :: JsonRenderer ;
15- use crate :: clean:: { self , ItemId } ;
15+ use crate :: clean;
1616
1717pub ( super ) type IdInterner = FxHashMap < FullItemId , types:: Id > ;
1818
@@ -66,20 +66,20 @@ pub(super) struct FullItemId {
6666}
6767
6868impl JsonRenderer < ' _ > {
69- pub ( crate ) fn id_from_item_default ( & self , item_id : ItemId ) -> Id {
69+ pub ( crate ) fn id_from_item_default ( & self , item_id : clean :: ItemId ) -> types :: Id {
7070 self . id_from_item_inner ( item_id, None , None )
7171 }
7272
7373 fn id_from_item_inner (
7474 & self ,
75- item_id : ItemId ,
75+ item_id : clean :: ItemId ,
7676 name : Option < Symbol > ,
7777 imported_id : Option < DefId > ,
78- ) -> Id {
78+ ) -> types :: Id {
7979 let ( def_id, mut extra_id) = match item_id {
80- ItemId :: DefId ( did) => ( did, None ) ,
81- ItemId :: Blanket { for_, impl_id } => ( for_, Some ( impl_id) ) ,
82- ItemId :: Auto { for_, trait_ } => ( for_, Some ( trait_) ) ,
80+ clean :: ItemId :: DefId ( did) => ( did, None ) ,
81+ clean :: ItemId :: Blanket { for_, impl_id } => ( for_, Some ( impl_id) ) ,
82+ clean :: ItemId :: Auto { for_, trait_ } => ( for_, Some ( trait_) ) ,
8383 } ;
8484
8585 let name = match name {
@@ -112,10 +112,10 @@ impl JsonRenderer<'_> {
112112 let len = interner. len ( ) ;
113113 * interner
114114 . entry ( key)
115- . or_insert_with ( || Id ( len. try_into ( ) . expect ( "too many items in a crate" ) ) )
115+ . or_insert_with ( || types :: Id ( len. try_into ( ) . expect ( "too many items in a crate" ) ) )
116116 }
117117
118- pub ( crate ) fn id_from_item ( & self , item : & clean:: Item ) -> Id {
118+ pub ( crate ) fn id_from_item ( & self , item : & clean:: Item ) -> types :: Id {
119119 match item. kind {
120120 clean:: ItemKind :: ImportItem ( ref import) => {
121121 let imported_id = import. source . did ;
0 commit comments