summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-06-02 20:48:53 -0700
committerNiko Matsakis <niko@alum.mit.edu>2012-06-06 18:36:15 -0700
commitbede54b14acb093e86a936d5ba62ff2af8b558d5 (patch)
tree1d55f928357e66573d9de0fe6be60174184491b6 /src/libcore
parentef32ffd0b1602ff87536508a7f75fd9b1510b4e9 (diff)
downloadrust-bede54b14acb093e86a936d5ba62ff2af8b558d5.tar.gz
rust-bede54b14acb093e86a936d5ba62ff2af8b558d5.zip
misc. copies in core/syntax to please borrowck
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/future.rs2
-rw-r--r--src/libcore/io.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/future.rs b/src/libcore/future.rs
index e0321b45287..6152b83536a 100644
--- a/src/libcore/future.rs
+++ b/src/libcore/future.rs
@@ -108,7 +108,7 @@ fn get<A:copy>(future: future<A>) -> A {
 fn with<A,B>(future: future<A>, blk: fn(A) -> B) -> B {
     #[doc = "Work with the value without copying it"];
 
-    let v = alt future.v {
+    let v = alt copy future.v {
       either::left(v) { v }
       either::right(f) {
         let v = @f();
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index 02371ea7625..b18be417019 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -613,7 +613,7 @@ impl of writer for mem_buffer {
         // FIXME #2004--use memcpy here?
         let mut pos = self.pos, vpos = 0u;
         while vpos < vlen && pos < buf_len {
-            self.buf.set_elt(pos, v[vpos]);
+            self.buf.set_elt(pos, copy v[vpos]);
             pos += 1u;
             vpos += 1u;
         }