@@ -133,14 +133,13 @@ fn decode_inlined_item(cdata: cstore::crate_metadata,
133133 to_id_range: to_id_range} ) ;
134134 let raw_ii = decode_ast ( ast_doc) ;
135135 let ii = renumber_ast ( xcx, raw_ii) ;
136- // XXX: Bad copy of `path`.
137- ast_map:: map_decoded_item ( tcx. sess . diagnostic ( ) ,
138- dcx. tcx . items , copy path, ii) ;
139136 debug ! ( "Fn named: %s" , tcx. sess. str_of( ii. ident( ) ) ) ;
140- decode_side_tables ( xcx, ast_doc) ;
141137 debug ! ( "< Decoded inlined fn: %s::%s" ,
142138 ast_map:: path_to_str( path, tcx. sess. parse_sess. interner) ,
143139 tcx. sess. str_of( ii. ident( ) ) ) ;
140+ ast_map:: map_decoded_item ( tcx. sess . diagnostic ( ) ,
141+ dcx. tcx . items , path, ii) ;
142+ decode_side_tables ( xcx, ast_doc) ;
144143 match ii {
145144 ast:: ii_item( i) => {
146145 debug ! ( ">>> DECODED ITEM >>>\n %s\n <<< DECODED ITEM <<<" ,
@@ -309,10 +308,13 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
309308 ast:: stmt_mac( * ) => fail ~"unexpanded macro in astencode"
310309 }
311310 } ;
312- // XXX: Bad copy.
313311 let blk_sans_items = ast:: blk_ {
312+ view_items : ~[ ] , // I don't know if we need the view_items here,
313+ // but it doesn't break tests!
314314 stmts : stmts_sans_items,
315- .. copy blk
315+ expr : blk. expr ,
316+ id : blk. id ,
317+ rules : blk. rules
316318 } ;
317319 fold:: noop_fold_block ( blk_sans_items, fld)
318320 }
@@ -592,7 +594,7 @@ fn encode_vtable_res(ecx: @e::encode_ctxt,
592594 // ty::t doesn't work, and there is no way (atm) to have
593595 // hand-written encoding routines combine with auto-generated
594596 // ones. perhaps we should fix this.
595- do ebml_w. emit_from_vec ( /*bad*/ copy * dr) |vtable_origin| {
597+ do ebml_w. emit_from_vec ( * dr) |vtable_origin| {
596598 encode_vtable_origin ( ecx, ebml_w, * vtable_origin)
597599 }
598600}
@@ -742,8 +744,7 @@ impl writer::Encoder: ebml_writer_helpers {
742744 }
743745
744746 fn emit_tys ( ecx : @e:: encode_ctxt , tys : ~[ ty:: t ] ) {
745- // XXX: Bad copy.
746- do self . emit_from_vec ( copy tys) |ty| {
747+ do self . emit_from_vec ( tys) |ty| {
747748 self . emit_ty ( ecx, * ty)
748749 }
749750 }
@@ -756,8 +757,8 @@ impl writer::Encoder: ebml_writer_helpers {
756757
757758 fn emit_tpbt ( ecx : @e:: encode_ctxt , tpbt : ty:: ty_param_bounds_and_ty ) {
758759 do self . emit_rec {
759- do self . emit_field ( ~"bounds", 0 u ) {
760- do self . emit_from_vec ( /*bad*/ copy * tpbt. bounds ) |bs| {
760+ do self . emit_field ( ~"bounds", 0 ) {
761+ do self . emit_from_vec ( * tpbt. bounds ) |bs| {
761762 self . emit_bounds ( ecx, * bs) ;
762763 }
763764 }
@@ -840,7 +841,7 @@ fn encode_side_tables_for_id(ecx: @e::encode_ctxt,
840841 do ebml_w. tag ( c:: tag_table_freevars) {
841842 ebml_w. id ( id) ;
842843 do ebml_w. tag ( c:: tag_table_val) {
843- do ebml_w. emit_from_vec ( /*bad*/ copy * * fv) |fv_entry| {
844+ do ebml_w. emit_from_vec ( * * fv) |fv_entry| {
844845 encode_freevar_entry ( ebml_w, * fv_entry)
845846 }
846847 }
0 commit comments