Remove some spurious copies that are identified by later patches

This commit is contained in:
Niko Matsakis 2013-05-29 18:10:34 -04:00
parent 7dfb865339
commit c492a2126f
3 changed files with 9 additions and 9 deletions

View file

@ -674,8 +674,8 @@ pub fn enter_tup<'r>(bcx: block,
let dummy = @ast::pat {id: 0, node: ast::pat_wild, span: dummy_sp()};
do enter_match(bcx, dm, m, col, val) |p| {
match p.node {
ast::pat_tup(/*bad*/copy elts) => {
Some(elts)
ast::pat_tup(ref elts) => {
Some(copy *elts)
}
_ => {
assert_is_binding_or_wild(bcx, p);
@ -702,7 +702,7 @@ pub fn enter_tuple_struct<'r>(bcx: block,
let dummy = @ast::pat {id: 0, node: ast::pat_wild, span: dummy_sp()};
do enter_match(bcx, dm, m, col, val) |p| {
match p.node {
ast::pat_enum(_, Some(/*bad*/copy elts)) => Some(elts),
ast::pat_enum(_, Some(ref elts)) => Some(copy *elts),
_ => {
assert_is_binding_or_wild(bcx, p);
Some(vec::from_elem(n_elts, dummy))

View file

@ -1726,7 +1726,7 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
let mut bcx = bcx;
match fcx.llself {
Some(copy slf) => {
Some(slf) => {
// We really should do this regardless of whether self is owned, but
// it doesn't work right with default method impls yet. (FIXME: #2794)
if slf.is_owned {
@ -1801,7 +1801,7 @@ pub fn build_return_block(fcx: fn_ctxt) {
pub fn tie_up_header_blocks(fcx: fn_ctxt, lltop: BasicBlockRef) {
let _icx = fcx.insn_ctxt("tie_up_header_blocks");
match fcx.llloadenv {
Some(copy ll) => {
Some(ll) => {
Br(raw_block(fcx, false, fcx.llstaticallocas), ll);
Br(raw_block(fcx, false, ll), lltop);
}

View file

@ -85,8 +85,8 @@ pub fn type_uses_for(ccx: @CrateContext, fn_id: def_id, n_tps: uint)
}
if fn_id_loc.crate != local_crate {
let Context { uses: @uses, _ } = cx;
let uses = @uses; // mutability
let Context { uses, _ } = cx;
let uses = @copy *uses; // freeze
ccx.type_use_cache.insert(fn_id, uses);
return uses;
}
@ -173,8 +173,8 @@ pub fn type_uses_for(ccx: @CrateContext, fn_id: def_id, n_tps: uint)
ccx.tcx.sess.parse_sess.interner)));
}
}
let Context { uses: @uses, _ } = cx;
let uses = @uses; // mutability
let Context { uses, _ } = cx;
let uses = @copy *uses; // freeze
ccx.type_use_cache.insert(fn_id, uses);
uses
}