@@ -777,6 +777,21 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
777
777
let bkts = create_index ( idx, hash_node_id) ;
778
778
encode_index ( ebml_w, bkts, write_int) ;
779
779
ebml_w. end_tag ( ) ;
780
+
781
+ /* Encode the constructor */
782
+ for ctor. each |ctor| {
783
+ debug ! { "encoding info for ctor %s %d" , * item. ident,
784
+ ctor. node. id} ;
785
+ vec:: push( * index, {
786
+ val: ctor. node. id,
787
+ pos: ebml_w. writer. tell( )
788
+ } ) ;
789
+ encode_info_for_fn( ecx, ebml_w, ctor. node. id, item. ident,
790
+ path, if tps. len( ) > 0 u {
791
+ some( ii_ctor( ctor, item. ident, tps,
792
+ local_def( item. id) ) ) }
793
+ else { none } , tps, ctor. node. dec) ;
794
+ }
780
795
}
781
796
item_impl( tps, traits, _, methods) => {
782
797
add_to_index( ) ;
@@ -891,23 +906,6 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::writer,
891
906
match check ecx. tcx. items. get( i. id) {
892
907
ast_map:: node_item( _, pt) => {
893
908
encode_info_for_item( ecx, ebml_w, i, index, * pt) ;
894
- /* encode ctor, then encode items */
895
- match i. node {
896
- item_class( tps, _, _, some( ctor) , m_dtor) => {
897
- debug ! { "encoding info for ctor %s %d" , * i. ident,
898
- ctor. node. id} ;
899
- vec:: push( * index, {
900
- val: ctor. node. id,
901
- pos: ebml_w. writer. tell( )
902
- } ) ;
903
- encode_info_for_fn( ecx, ebml_w, ctor. node. id, i. ident,
904
- * pt, if tps. len( ) > 0 u {
905
- some( ii_ctor( ctor, i. ident, tps,
906
- local_def( i. id) ) ) }
907
- else { none } , tps, ctor. node. dec) ;
908
- }
909
- _ => { }
910
- }
911
909
}
912
910
}
913
911
} ,
0 commit comments