@@ -396,32 +396,34 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
396
396
let impls = ecx. impl_map( id) ;
397
397
for impls. each |i| {
398
398
let ( ident, did) = i;
399
- #debug( "(encoding info for module) ... encoding impl %s (%?), \
399
+ #debug( "(encoding info for module) ... encoding impl %s (%?/%? ), \
400
400
exported? %?",
401
- * ident, did, ast_util:: is_exported( ident, md) ) ;
402
- if ast_util:: is_exported( ident, md) {
403
- ebml_w. start_tag( tag_mod_impl) ;
404
- alt ecx. tcx. items. find( did. node) {
405
- some( ast_map:: node_item( it @@{ node : cl@item_class( * ) , _} , _) ) {
406
- /* If did stands for a trait
407
- ref, we need to map it to its parent class */
408
- ebml_w. wr_str( def_to_str( local_def( it. id) ) ) ;
409
- }
410
- some ( ast_map:: node_item( @{ node : item_impl( _,
411
- some( ifce) , _, _) , _} , _) ) {
412
- ebml_w. wr_str( def_to_str( did) ) ;
413
- }
414
- some( _) {
415
- ebml_w. wr_str( def_to_str( did) ) ;
416
- }
417
- none {
418
- // Must be a re-export, then!
419
- // ...or an iface ref
420
- ebml_w. wr_str( def_to_str( did) ) ;
421
- }
422
- } ;
423
- ebml_w. end_tag( ) ;
424
- } // if
401
+ * ident,
402
+ did,
403
+ ast_map:: node_id_to_str( ecx. tcx. items, did. node) ,
404
+ ast_util:: is_exported( ident, md) ) ;
405
+
406
+ ebml_w. start_tag( tag_mod_impl) ;
407
+ alt ecx. tcx. items. find( did. node) {
408
+ some( ast_map:: node_item( it @@{ node : cl@item_class( * ) , _} , _) ) {
409
+ /* If did stands for a trait
410
+ ref, we need to map it to its parent class */
411
+ ebml_w. wr_str( def_to_str( local_def( it. id) ) ) ;
412
+ }
413
+ some ( ast_map:: node_item( @{ node : item_impl( _,
414
+ some( ifce) , _, _) , _} , _) ) {
415
+ ebml_w. wr_str( def_to_str( did) ) ;
416
+ }
417
+ some( _) {
418
+ ebml_w. wr_str( def_to_str( did) ) ;
419
+ }
420
+ none {
421
+ // Must be a re-export, then!
422
+ // ...or an iface ref
423
+ ebml_w. wr_str( def_to_str( did) ) ;
424
+ }
425
+ } ;
426
+ ebml_w. end_tag( ) ;
425
427
} // for
426
428
427
429
encode_path( ebml_w, path, ast_map:: path_mod( name) ) ;
@@ -552,7 +554,14 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
552
554
553
555
let tcx = ecx. tcx;
554
556
let must_write =
555
- alt item. node { item_enum( _, _) { true } _ { false } } ;
557
+ alt item. node {
558
+ item_enum( _, _) | item_impl( * ) | item_trait( * ) | item_class ( * ) {
559
+ true
560
+ }
561
+ _ {
562
+ false
563
+ }
564
+ } ;
556
565
if !must_write && !reachable( ecx, item. id) { ret; }
557
566
558
567
fn add_to_index_( item: @item, ebml_w: ebml:: writer,
0 commit comments