@@ -298,7 +298,7 @@ fn encode_enum_variant_info(ecx: @encode_ctxt, ebml_w: writer::Encoder,
298
298
disr_val = vi[ i] . disr_val ;
299
299
}
300
300
encode_type_param_bounds ( ebml_w, ecx, /*bad*/ copy ty_params) ;
301
- encode_path ( ecx, ebml_w, /*bad*/ copy path,
301
+ encode_path ( ecx, ebml_w, & path,
302
302
ast_map:: path_name ( variant. node . name ) ) ;
303
303
ebml_w. end_tag ( ) ;
304
304
disr_val += 1 ;
@@ -307,7 +307,7 @@ fn encode_enum_variant_info(ecx: @encode_ctxt, ebml_w: writer::Encoder,
307
307
}
308
308
309
309
fn encode_path ( ecx : @encode_ctxt , ebml_w : writer:: Encoder ,
310
- path : ast_map:: path , name : ast_map:: path_elt ) {
310
+ path : & ast_map:: path , name : ast_map:: path_elt ) {
311
311
fn encode_path_elt ( ecx : @encode_ctxt , ebml_w : writer:: Encoder ,
312
312
elt : ast_map:: path_elt ) {
313
313
let ( tag, name) = match elt {
@@ -319,8 +319,8 @@ fn encode_path(ecx: @encode_ctxt, ebml_w: writer::Encoder,
319
319
}
320
320
321
321
do ebml_w. wr_tag ( tag_path) {
322
- ebml_w. wr_tagged_u32 ( tag_path_len, ( vec :: len ( path ) + 1 u ) as u32 ) ;
323
- for vec :: each ( path) |pe| {
322
+ ebml_w. wr_tagged_u32 ( tag_path_len, ( path . len ( ) + 1 ) as u32 ) ;
323
+ for path. each |pe| {
324
324
encode_path_elt( ecx, ebml_w, * pe) ;
325
325
}
326
326
encode_path_elt ( ecx, ebml_w, name) ;
@@ -353,11 +353,11 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: writer::Encoder,
353
353
ebml_w. wr_str ( def_to_str ( local_def ( did) ) ) ;
354
354
ebml_w. end_tag ( ) ;
355
355
}
356
- _ => { } // XXX : Encode these too.
356
+ _ => { } // FIXME #4573 : Encode these too.
357
357
}
358
358
}
359
359
360
- encode_path ( ecx, ebml_w, path, ast_map:: path_mod ( name) ) ;
360
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_mod ( name) ) ;
361
361
362
362
// Encode the reexports of this module.
363
363
debug ! ( "(encoding info for module) encoding reexports for %d" , id) ;
@@ -455,8 +455,7 @@ fn encode_info_for_struct(ecx: @encode_ctxt, ebml_w: writer::Encoder,
455
455
tcx. sess. str_of( nm) , id) ;
456
456
encode_visibility ( ebml_w, vis) ;
457
457
encode_name ( ecx, ebml_w, nm) ;
458
- encode_path ( ecx, ebml_w, /*bad*/ copy path,
459
- ast_map:: path_name ( nm) ) ;
458
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( nm) ) ;
460
459
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, id) ) ;
461
460
encode_mutability ( ebml_w, mt) ;
462
461
encode_def_id ( ebml_w, local_def ( id) ) ;
@@ -482,8 +481,7 @@ fn encode_info_for_ctor(ecx: @encode_ctxt, ebml_w: writer::Encoder,
482
481
ecx. tcx. sess. str_of( ident) ,
483
482
ty_to_str( ecx. tcx, its_ty) , id) ;
484
483
encode_type ( ecx, ebml_w, its_ty) ;
485
- // XXX: Bad copy.
486
- encode_path ( ecx, ebml_w, copy path, ast_map:: path_name ( ident) ) ;
484
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( ident) ) ;
487
485
match item {
488
486
Some ( ref it) => {
489
487
( ecx. encode_inlined_item ) ( ecx, ebml_w, path, ( * it) ) ;
@@ -516,8 +514,7 @@ fn encode_info_for_method(ecx: @encode_ctxt,
516
514
encode_type_param_bounds ( ebml_w, ecx, all_tps) ;
517
515
encode_type ( ecx, ebml_w, node_id_to_type ( ecx. tcx , m. id ) ) ;
518
516
encode_name ( ecx, ebml_w, m. ident ) ;
519
- // XXX: Bad copy.
520
- encode_path ( ecx, ebml_w, copy impl_path, ast_map:: path_name ( m. ident ) ) ;
517
+ encode_path ( ecx, ebml_w, & impl_path, ast_map:: path_name ( m. ident ) ) ;
521
518
encode_self_type ( ebml_w, m. self_ty . node ) ;
522
519
if len > 0 u || should_inline {
523
520
( ecx. encode_inlined_item ) (
@@ -585,7 +582,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
585
582
encode_family ( ebml_w, 'c' ) ;
586
583
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, item. id ) ) ;
587
584
encode_symbol ( ecx, ebml_w, item. id ) ;
588
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( item. ident ) ) ;
585
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
589
586
ebml_w. end_tag ( ) ;
590
587
}
591
588
item_fn( _, purity, tps, _) => {
@@ -596,8 +593,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
596
593
let tps_len = tps. len ( ) ;
597
594
encode_type_param_bounds ( ebml_w, ecx, tps) ;
598
595
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, item. id ) ) ;
599
- // XXX: Bad copy.
600
- encode_path ( ecx, ebml_w, copy path, ast_map:: path_name ( item. ident ) ) ;
596
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
601
597
encode_attributes ( ebml_w, /*bad*/ copy item. attrs ) ;
602
598
if tps_len > 0 u || should_inline ( item. attrs ) {
603
599
( ecx. encode_inlined_item ) ( ecx, ebml_w, path, ii_item ( item) ) ;
@@ -616,7 +612,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
616
612
encode_def_id ( ebml_w, local_def ( item. id ) ) ;
617
613
encode_family ( ebml_w, 'n' ) ;
618
614
encode_name ( ecx, ebml_w, item. ident ) ;
619
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( item. ident ) ) ;
615
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
620
616
ebml_w. end_tag ( ) ;
621
617
}
622
618
item_ty( _, tps) => {
@@ -627,7 +623,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
627
623
encode_type_param_bounds ( ebml_w, ecx, tps) ;
628
624
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, item. id ) ) ;
629
625
encode_name ( ecx, ebml_w, item. ident ) ;
630
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( item. ident ) ) ;
626
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
631
627
encode_region_param ( ecx, ebml_w, item) ;
632
628
ebml_w. end_tag ( ) ;
633
629
}
@@ -644,8 +640,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
644
640
}
645
641
( ecx. encode_inlined_item ) ( ecx, ebml_w, /*bad*/ copy path,
646
642
ii_item ( item) ) ;
647
- encode_path ( ecx, ebml_w, /*bad*/ copy path,
648
- ast_map:: path_name ( item. ident ) ) ;
643
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
649
644
encode_region_param ( ecx, ebml_w, item) ;
650
645
}
651
646
encode_enum_variant_info( ecx,
@@ -686,7 +681,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
686
681
encode_type_param_bounds ( ebml_w, ecx, tps) ;
687
682
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, item. id ) ) ;
688
683
encode_name ( ecx, ebml_w, item. ident ) ;
689
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( item. ident ) ) ;
684
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
690
685
encode_region_param ( ecx, ebml_w, item) ;
691
686
/* Encode the dtor */
692
687
/* Encode id for dtor */
@@ -744,8 +739,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
744
739
do opt_trait. iter ( ) |associated_trait| {
745
740
encode_trait_ref ( ebml_w, ecx, * associated_trait) ;
746
741
}
747
- // XXX: Bad copy.
748
- encode_path ( ecx, ebml_w, copy path, ast_map:: path_name ( item. ident ) ) ;
742
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
749
743
ebml_w. end_tag ( ) ;
750
744
751
745
let impl_path = vec:: append_one ( path,
@@ -801,8 +795,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
801
795
}
802
796
i += 1 u;
803
797
}
804
- // XXX: Bad copy.
805
- encode_path ( ecx, ebml_w, copy path, ast_map:: path_name ( item. ident ) ) ;
798
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( item. ident ) ) ;
806
799
for traits. each |associated_trait| {
807
800
encode_trait_ref( ebml_w, ecx, * associated_trait)
808
801
}
@@ -830,7 +823,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
830
823
encode_type ( ecx, ebml_w, polyty. ty ) ;
831
824
let m_path = vec:: append_one ( /*bad*/ copy path,
832
825
ast_map:: path_name ( item. ident ) ) ;
833
- encode_path ( ecx, ebml_w, m_path, ast_map:: path_name ( ty_m. ident ) ) ;
826
+ encode_path ( ecx, ebml_w, & m_path, ast_map:: path_name ( ty_m. ident ) ) ;
834
827
ebml_w. end_tag ( ) ;
835
828
}
836
829
@@ -868,14 +861,14 @@ fn encode_info_for_foreign_item(ecx: @encode_ctxt,
868
861
} else {
869
862
encode_symbol ( ecx, ebml_w, nitem. id ) ;
870
863
}
871
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( nitem. ident ) ) ;
864
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( nitem. ident ) ) ;
872
865
}
873
866
foreign_item_const( * ) => {
874
867
encode_def_id ( ebml_w, local_def ( nitem. id ) ) ;
875
868
encode_family ( ebml_w, 'c' ) ;
876
869
encode_type ( ecx, ebml_w, node_id_to_type ( ecx. tcx , nitem. id ) ) ;
877
870
encode_symbol ( ecx, ebml_w, nitem. id ) ;
878
- encode_path ( ecx, ebml_w, path, ast_map:: path_name ( nitem. ident ) ) ;
871
+ encode_path ( ecx, ebml_w, & path, ast_map:: path_name ( nitem. ident ) ) ;
879
872
}
880
873
}
881
874
ebml_w. end_tag ( ) ;
0 commit comments