@@ -21,10 +21,10 @@ use metadata::common::*;
21
21
use metadata:: cstore;
22
22
use metadata:: decoder;
23
23
use metadata:: tyencode;
24
+ use middle:: def;
24
25
use middle:: ty:: { lookup_item_type} ;
25
26
use middle:: ty:: { mod, Ty } ;
26
27
use middle:: stability;
27
- use middle;
28
28
use util:: nodemap:: { FnvHashMap , NodeMap , NodeSet } ;
29
29
30
30
use serialize:: Encodable ;
@@ -66,7 +66,7 @@ pub type EncodeInlinedItem<'a> = |ecx: &EncodeContext,
66
66
pub struct EncodeParams < ' a , ' tcx : ' a > {
67
67
pub diag: & ' a SpanHandler ,
68
68
pub tcx: & ' a ty:: ctxt<' tcx>,
69
- pub reexports2 : & ' a middle :: resolve :: ExportMap2 ,
69
+ pub reexports : & ' a def :: ExportMap ,
70
70
pub item_symbols: & ' a RefCell <NodeMap <String >>,
71
71
pub link_meta: & ' a LinkMeta ,
72
72
pub cstore: & ' a cstore:: CStore ,
@@ -77,7 +77,7 @@ pub struct EncodeParams<'a, 'tcx: 'a> {
77
77
pub struct EncodeContext < ' a , ' tcx : ' a > {
78
78
pub diag : & ' a SpanHandler ,
79
79
pub tcx : & ' a ty:: ctxt < ' tcx > ,
80
- pub reexports2 : & ' a middle :: resolve :: ExportMap2 ,
80
+ pub reexports : & ' a def :: ExportMap ,
81
81
pub item_symbols : & ' a RefCell < NodeMap < String > > ,
82
82
pub link_meta : & ' a LinkMeta ,
83
83
pub cstore : & ' a cstore:: CStore ,
@@ -379,7 +379,7 @@ fn encode_path<PI: Iterator<PathElem>>(rbml_w: &mut Encoder, path: PI) {
379
379
}
380
380
381
381
fn encode_reexported_static_method ( rbml_w : & mut Encoder ,
382
- exp : & middle :: resolve :: Export2 ,
382
+ exp : & def :: Export ,
383
383
method_def_id : DefId ,
384
384
method_name : ast:: Name ) {
385
385
debug ! ( "(encode reexported static method) {}::{}" ,
@@ -398,7 +398,7 @@ fn encode_reexported_static_method(rbml_w: &mut Encoder,
398
398
399
399
fn encode_reexported_static_base_methods ( ecx : & EncodeContext ,
400
400
rbml_w : & mut Encoder ,
401
- exp : & middle :: resolve :: Export2 )
401
+ exp : & def :: Export )
402
402
-> bool {
403
403
let impl_items = ecx. tcx . impl_items . borrow ( ) ;
404
404
match ecx. tcx . inherent_impls . borrow ( ) . get ( & exp. def_id ) {
@@ -428,7 +428,7 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
428
428
429
429
fn encode_reexported_static_trait_methods ( ecx : & EncodeContext ,
430
430
rbml_w : & mut Encoder ,
431
- exp : & middle :: resolve :: Export2 )
431
+ exp : & def :: Export )
432
432
-> bool {
433
433
match ecx. tcx . trait_items_cache . borrow ( ) . get ( & exp. def_id ) {
434
434
Some ( trait_items) => {
@@ -449,10 +449,8 @@ fn encode_reexported_static_trait_methods(ecx: &EncodeContext,
449
449
fn encode_reexported_static_methods ( ecx : & EncodeContext ,
450
450
rbml_w : & mut Encoder ,
451
451
mod_path : PathElems ,
452
- exp : & middle :: resolve :: Export2 ) {
452
+ exp : & def :: Export ) {
453
453
if let Some ( ast_map:: NodeItem ( item) ) = ecx. tcx . map . find ( exp. def_id . node ) {
454
- let original_name = token:: get_ident ( item. ident ) ;
455
-
456
454
let path_differs = ecx. tcx . map . with_path ( exp. def_id . node , |path| {
457
455
let ( mut a, mut b) = ( path, mod_path. clone ( ) ) ;
458
456
loop {
@@ -474,16 +472,16 @@ fn encode_reexported_static_methods(ecx: &EncodeContext,
474
472
// encoded metadata for static methods relative to Bar,
475
473
// but not yet for Foo.
476
474
//
477
- if path_differs || original_name . get ( ) != exp. name {
475
+ if path_differs || item . ident . name != exp. name {
478
476
if !encode_reexported_static_base_methods ( ecx, rbml_w, exp) {
479
477
if encode_reexported_static_trait_methods ( ecx, rbml_w, exp) {
480
478
debug ! ( "(encode reexported static methods) {} [trait]" ,
481
- original_name ) ;
479
+ item . ident . name ) ;
482
480
}
483
481
}
484
482
else {
485
483
debug ! ( "(encode reexported static methods) {} [base]" ,
486
- original_name ) ;
484
+ item . ident . name ) ;
487
485
}
488
486
}
489
487
}
@@ -519,7 +517,7 @@ fn encode_reexports(ecx: &EncodeContext,
519
517
id : NodeId ,
520
518
path : PathElems ) {
521
519
debug ! ( "(encoding info for module) encoding reexports for {}" , id) ;
522
- match ecx. reexports2 . get ( & id) {
520
+ match ecx. reexports . get ( & id) {
523
521
Some ( ref exports) => {
524
522
debug ! ( "(encoding info for module) found reexports for {}" , id) ;
525
523
for exp in exports. iter ( ) {
@@ -534,7 +532,7 @@ fn encode_reexports(ecx: &EncodeContext,
534
532
rbml_w. wr_str ( def_to_string ( exp. def_id ) . as_slice ( ) ) ;
535
533
rbml_w. end_tag ( ) ;
536
534
rbml_w. start_tag ( tag_items_data_item_reexport_name) ;
537
- rbml_w. wr_str ( exp. name . as_slice ( ) ) ;
535
+ rbml_w. wr_str ( exp. name . as_str ( ) ) ;
538
536
rbml_w. end_tag ( ) ;
539
537
rbml_w. end_tag ( ) ;
540
538
encode_reexported_static_methods ( ecx, rbml_w, path. clone ( ) , exp) ;
@@ -2071,7 +2069,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2071
2069
item_symbols,
2072
2070
diag,
2073
2071
tcx,
2074
- reexports2 ,
2072
+ reexports ,
2075
2073
cstore,
2076
2074
encode_inlined_item,
2077
2075
link_meta,
@@ -2081,7 +2079,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
2081
2079
let ecx = EncodeContext {
2082
2080
diag : diag,
2083
2081
tcx : tcx,
2084
- reexports2 : reexports2 ,
2082
+ reexports : reexports ,
2085
2083
item_symbols : item_symbols,
2086
2084
link_meta : link_meta,
2087
2085
cstore : cstore,
0 commit comments