@@ -133,14 +133,13 @@ fn decode_inlined_item(cdata: cstore::crate_metadata,
133
133
to_id_range: to_id_range} ) ;
134
134
let raw_ii = decode_ast ( ast_doc) ;
135
135
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) ;
139
136
debug ! ( "Fn named: %s" , tcx. sess. str_of( ii. ident( ) ) ) ;
140
- decode_side_tables ( xcx, ast_doc) ;
141
137
debug ! ( "< Decoded inlined fn: %s::%s" ,
142
138
ast_map:: path_to_str( path, tcx. sess. parse_sess. interner) ,
143
139
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) ;
144
143
match ii {
145
144
ast:: ii_item( i) => {
146
145
debug ! ( ">>> DECODED ITEM >>>\n %s\n <<< DECODED ITEM <<<" ,
@@ -309,10 +308,13 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
309
308
ast:: stmt_mac( * ) => fail ~"unexpanded macro in astencode"
310
309
}
311
310
} ;
312
- // XXX: Bad copy.
313
311
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!
314
314
stmts : stmts_sans_items,
315
- .. copy blk
315
+ expr : blk. expr ,
316
+ id : blk. id ,
317
+ rules : blk. rules
316
318
} ;
317
319
fold:: noop_fold_block ( blk_sans_items, fld)
318
320
}
@@ -592,7 +594,7 @@ fn encode_vtable_res(ecx: @e::encode_ctxt,
592
594
// ty::t doesn't work, and there is no way (atm) to have
593
595
// hand-written encoding routines combine with auto-generated
594
596
// 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| {
596
598
encode_vtable_origin ( ecx, ebml_w, * vtable_origin)
597
599
}
598
600
}
@@ -742,8 +744,7 @@ impl writer::Encoder: ebml_writer_helpers {
742
744
}
743
745
744
746
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| {
747
748
self . emit_ty ( ecx, * ty)
748
749
}
749
750
}
@@ -756,8 +757,8 @@ impl writer::Encoder: ebml_writer_helpers {
756
757
757
758
fn emit_tpbt ( ecx : @e:: encode_ctxt , tpbt : ty:: ty_param_bounds_and_ty ) {
758
759
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| {
761
762
self . emit_bounds ( ecx, * bs) ;
762
763
}
763
764
}
@@ -840,7 +841,7 @@ fn encode_side_tables_for_id(ecx: @e::encode_ctxt,
840
841
do ebml_w. tag ( c:: tag_table_freevars) {
841
842
ebml_w. id ( id) ;
842
843
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| {
844
845
encode_freevar_entry ( ebml_w, * fv_entry)
845
846
}
846
847
}
0 commit comments