@@ -21,10 +21,10 @@ use metadata::common::*;
2121use metadata:: cstore;
2222use metadata:: decoder;
2323use metadata:: tyencode;
24+ use middle:: def;
2425use middle:: ty:: { lookup_item_type} ;
2526use middle:: ty:: { mod, Ty } ;
2627use middle:: stability;
27- use middle;
2828use util:: nodemap:: { FnvHashMap , NodeMap , NodeSet } ;
2929
3030use serialize:: Encodable ;
@@ -66,7 +66,7 @@ pub type EncodeInlinedItem<'a> = |ecx: &EncodeContext,
6666pub struct EncodeParams < ' a , ' tcx : ' a > {
6767 pub diag: & ' a SpanHandler ,
6868 pub tcx: & ' a ty:: ctxt<' tcx>,
69- pub reexports2 : & ' a middle :: resolve :: ExportMap2 ,
69+ pub reexports : & ' a def :: ExportMap ,
7070 pub item_symbols: & ' a RefCell <NodeMap <String >>,
7171 pub link_meta: & ' a LinkMeta ,
7272 pub cstore: & ' a cstore:: CStore ,
@@ -77,7 +77,7 @@ pub struct EncodeParams<'a, 'tcx: 'a> {
7777pub struct EncodeContext < ' a , ' tcx : ' a > {
7878 pub diag : & ' a SpanHandler ,
7979 pub tcx : & ' a ty:: ctxt < ' tcx > ,
80- pub reexports2 : & ' a middle :: resolve :: ExportMap2 ,
80+ pub reexports : & ' a def :: ExportMap ,
8181 pub item_symbols : & ' a RefCell < NodeMap < String > > ,
8282 pub link_meta : & ' a LinkMeta ,
8383 pub cstore : & ' a cstore:: CStore ,
@@ -379,7 +379,7 @@ fn encode_path<PI: Iterator<PathElem>>(rbml_w: &mut Encoder, path: PI) {
379379}
380380
381381fn encode_reexported_static_method ( rbml_w : & mut Encoder ,
382- exp : & middle :: resolve :: Export2 ,
382+ exp : & def :: Export ,
383383 method_def_id : DefId ,
384384 method_name : ast:: Name ) {
385385 debug ! ( "(encode reexported static method) {}::{}" ,
@@ -398,7 +398,7 @@ fn encode_reexported_static_method(rbml_w: &mut Encoder,
398398
399399fn encode_reexported_static_base_methods ( ecx : & EncodeContext ,
400400 rbml_w : & mut Encoder ,
401- exp : & middle :: resolve :: Export2 )
401+ exp : & def :: Export )
402402 -> bool {
403403 let impl_items = ecx. tcx . impl_items . borrow ( ) ;
404404 match ecx. tcx . inherent_impls . borrow ( ) . get ( & exp. def_id ) {
@@ -428,7 +428,7 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
428428
429429fn encode_reexported_static_trait_methods ( ecx : & EncodeContext ,
430430 rbml_w : & mut Encoder ,
431- exp : & middle :: resolve :: Export2 )
431+ exp : & def :: Export )
432432 -> bool {
433433 match ecx. tcx . trait_items_cache . borrow ( ) . get ( & exp. def_id ) {
434434 Some ( trait_items) => {
@@ -449,10 +449,8 @@ fn encode_reexported_static_trait_methods(ecx: &EncodeContext,
449449fn encode_reexported_static_methods ( ecx : & EncodeContext ,
450450 rbml_w : & mut Encoder ,
451451 mod_path : PathElems ,
452- exp : & middle :: resolve :: Export2 ) {
452+ exp : & def :: Export ) {
453453 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-
456454 let path_differs = ecx. tcx . map . with_path ( exp. def_id . node , |path| {
457455 let ( mut a, mut b) = ( path, mod_path. clone ( ) ) ;
458456 loop {
@@ -474,16 +472,16 @@ fn encode_reexported_static_methods(ecx: &EncodeContext,
474472 // encoded metadata for static methods relative to Bar,
475473 // but not yet for Foo.
476474 //
477- if path_differs || original_name . get ( ) != exp. name {
475+ if path_differs || item . ident . name != exp. name {
478476 if !encode_reexported_static_base_methods ( ecx, rbml_w, exp) {
479477 if encode_reexported_static_trait_methods ( ecx, rbml_w, exp) {
480478 debug ! ( "(encode reexported static methods) {} [trait]" ,
481- original_name ) ;
479+ item . ident . name ) ;
482480 }
483481 }
484482 else {
485483 debug ! ( "(encode reexported static methods) {} [base]" ,
486- original_name ) ;
484+ item . ident . name ) ;
487485 }
488486 }
489487 }
@@ -519,7 +517,7 @@ fn encode_reexports(ecx: &EncodeContext,
519517 id : NodeId ,
520518 path : PathElems ) {
521519 debug ! ( "(encoding info for module) encoding reexports for {}" , id) ;
522- match ecx. reexports2 . get ( & id) {
520+ match ecx. reexports . get ( & id) {
523521 Some ( ref exports) => {
524522 debug ! ( "(encoding info for module) found reexports for {}" , id) ;
525523 for exp in exports. iter ( ) {
@@ -534,7 +532,7 @@ fn encode_reexports(ecx: &EncodeContext,
534532 rbml_w. wr_str ( def_to_string ( exp. def_id ) . as_slice ( ) ) ;
535533 rbml_w. end_tag ( ) ;
536534 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 ( ) ) ;
538536 rbml_w. end_tag ( ) ;
539537 rbml_w. end_tag ( ) ;
540538 encode_reexported_static_methods ( ecx, rbml_w, path. clone ( ) , exp) ;
@@ -2071,7 +2069,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
20712069 item_symbols,
20722070 diag,
20732071 tcx,
2074- reexports2 ,
2072+ reexports ,
20752073 cstore,
20762074 encode_inlined_item,
20772075 link_meta,
@@ -2081,7 +2079,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
20812079 let ecx = EncodeContext {
20822080 diag : diag,
20832081 tcx : tcx,
2084- reexports2 : reexports2 ,
2082+ reexports : reexports ,
20852083 item_symbols : item_symbols,
20862084 link_meta : link_meta,
20872085 cstore : cstore,
0 commit comments