@@ -21,14 +21,15 @@ use middle::lang_items;
21
21
use middle:: ty:: { self , Ty } ;
22
22
use middle:: def_id:: { DefId , DefIndex } ;
23
23
24
- use rustc:: front:: map as ast_map ;
24
+ use rustc:: front:: map as hir_map ;
25
25
use rustc:: util:: nodemap:: { FnvHashMap , NodeMap , NodeSet } ;
26
26
27
27
use std:: cell:: RefCell ;
28
28
use std:: rc:: Rc ;
29
29
use std:: path:: PathBuf ;
30
30
use syntax:: ast;
31
31
use syntax:: attr;
32
+ use syntax:: parse:: token;
32
33
use rustc_back:: svh:: Svh ;
33
34
use rustc_back:: target:: Target ;
34
35
use rustc_front:: hir;
@@ -115,7 +116,7 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
115
116
decoder:: get_method_arg_names ( & cdata, did. index )
116
117
}
117
118
118
- fn item_path ( & self , def : DefId ) -> Vec < ast_map :: PathElem > {
119
+ fn item_path ( & self , def : DefId ) -> Vec < hir_map :: PathElem > {
119
120
let cdata = self . get_crate_data ( def. krate ) ;
120
121
let path = decoder:: get_item_path ( & * cdata, def. index ) ;
121
122
@@ -127,6 +128,17 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
127
128
} )
128
129
}
129
130
131
+ fn extern_item_path ( & self , def : DefId ) -> Vec < hir_map:: PathElem > {
132
+ let cdata = self . get_crate_data ( def. krate ) ;
133
+ let path = decoder:: get_item_path ( & * cdata, def. index ) ;
134
+
135
+ let mut r = Vec :: with_capacity ( path. len ( ) + 1 ) ;
136
+ let crate_name = hir_map:: PathMod ( token:: intern ( & cdata. name ) ) ;
137
+ r. push ( crate_name) ;
138
+ r. push_all ( & path) ;
139
+ r
140
+ }
141
+
130
142
fn item_name ( & self , def : DefId ) -> ast:: Name {
131
143
let cdata = self . get_crate_data ( def. krate ) ;
132
144
decoder:: get_item_name ( & self . intr , & cdata, def. index )
@@ -350,7 +362,7 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore {
350
362
decoder:: get_reachable_ids ( & * cdata)
351
363
}
352
364
353
- fn def_path ( & self , def : DefId ) -> ast_map :: DefPath
365
+ fn def_path ( & self , def : DefId ) -> hir_map :: DefPath
354
366
{
355
367
let cdata = self . get_crate_data ( def. krate ) ;
356
368
let path = decoder:: def_path ( & * cdata, def. index ) ;
0 commit comments