Workarounds for bug #2280: add some temporaries for borrowing.

This commit is contained in:
Graydon Hoare 2012-04-24 15:18:24 -07:00
parent e7dbf42214
commit 929c3dd710
4 changed files with 16 additions and 4 deletions

View File

@ -423,7 +423,10 @@ fn configure(opts: options) -> cargo {
fn for_each_package(c: cargo, b: fn(source, package)) {
for c.sources.each_value {|v|
for vec::each(copy v.packages) {|p|
// FIXME (#2280): this temporary shouldn't be
// necessary, but seems to be, for borrowing.
let pks = copy v.packages;
for vec::each(pks) {|p|
b(v, p);
}
}

View File

@ -5096,7 +5096,10 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
io::println(#fmt("n_null_glues: %u", ccx.stats.n_null_glues));
io::println(#fmt("n_real_glues: %u", ccx.stats.n_real_glues));
for vec::each(copy *ccx.stats.fn_times) {|timing|
// FIXME (#2280): this temporary shouldn't be
// necessary, but seems to be, for borrowing.
let times = copy *ccx.stats.fn_times;
for vec::each(times) {|timing|
io::println(#fmt("time: %s took %d ms", timing.ident,
timing.time));
}

View File

@ -727,7 +727,10 @@ fn find_instances(_fcx: fn_ctxt, subst: subst, c: constraint) ->
alt c {
cinit(_, _, _) {/* this is dealt with separately */ }
cpred(p, descs) {
for vec::each(copy *descs) {|d|
// FIXME (#2280): this temporary shouldn't be
// necessary, but seems to be, for borrowing.
let ds = copy *descs;
for vec::each(ds) {|d|
if args_mention(d.node.args, find_in_subst_bool, subst) {
let old_bit_num = d.node.bit_num;
let newv = replace(subst, d);

View File

@ -119,7 +119,10 @@ fn writer(path: str, writech: comm::chan<comm::chan<line>>, size: uint)
while prev <= i {
if lines.contains_key(prev) {
#debug("WS %u", prev);
cout.write(lines.get(prev));
// FIXME (#2280): this temporary shouldn't be
// necessary, but seems to be, for borrowing.
let v : [u8] = lines.get(prev);
cout.write(v);
done += 1_u;
lines.remove(prev);
prev += 1_u;