@@ -363,6 +363,47 @@ fn encode_path(ecx: @EncodeContext,
363
363
ebml_w. end_tag ( ) ;
364
364
}
365
365
366
+ fn encode_reexported_static_method ( ecx : @EncodeContext ,
367
+ ebml_w : & mut writer:: Encoder ,
368
+ exp : & middle:: resolve:: Export2 ,
369
+ m : @ty:: method ) {
370
+ debug ! ( "(encode static trait method) reexport '%s::%s'" ,
371
+ * exp. name, * ecx. tcx. sess. str_of( m. ident) ) ;
372
+ ebml_w. start_tag ( tag_items_data_item_reexport) ;
373
+ ebml_w. start_tag ( tag_items_data_item_reexport_def_id) ;
374
+ ebml_w. wr_str ( def_to_str ( m. def_id ) ) ;
375
+ ebml_w. end_tag ( ) ;
376
+ ebml_w. start_tag ( tag_items_data_item_reexport_name) ;
377
+ ebml_w. wr_str ( * exp. name + "::" + * ecx. tcx . sess . str_of ( m. ident ) ) ;
378
+ ebml_w. end_tag ( ) ;
379
+ ebml_w. end_tag ( ) ;
380
+ }
381
+
382
+ fn encode_reexported_static_methods ( ecx : @EncodeContext ,
383
+ ebml_w : & mut writer:: Encoder ,
384
+ mod_path : & [ ast_map:: path_elt ] ,
385
+ exp : & middle:: resolve:: Export2 ) {
386
+ match ecx. tcx . trait_methods_cache . find ( & exp. def_id ) {
387
+ Some ( methods) => {
388
+ match ecx. tcx . items . find ( & exp. def_id . node ) {
389
+ Some ( & ast_map:: node_item( _, path) ) => {
390
+ if mod_path != * path {
391
+ for methods. each |& m| {
392
+ if m. self_ty == ast:: sty_static {
393
+ encode_reexported_static_method ( ecx,
394
+ ebml_w,
395
+ exp, m) ;
396
+ }
397
+ }
398
+ }
399
+ }
400
+ _ => { }
401
+ }
402
+ }
403
+ _ => { }
404
+ }
405
+ }
406
+
366
407
fn encode_info_for_mod ( ecx : @EncodeContext ,
367
408
ebml_w : & mut writer:: Encoder ,
368
409
md : & _mod ,
@@ -413,6 +454,7 @@ fn encode_info_for_mod(ecx: @EncodeContext,
413
454
ebml_w. wr_str ( * exp. name ) ;
414
455
ebml_w. end_tag ( ) ;
415
456
ebml_w. end_tag ( ) ;
457
+ encode_reexported_static_methods ( ecx, ebml_w, path, exp) ;
416
458
}
417
459
}
418
460
None => {
0 commit comments