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(future: future) -> A { fn with(future: future, 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 @@ fn write(v: [const u8]/&) { // 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; } diff --git a/src/libsyntax/ext/qquote.rs b/src/libsyntax/ext/qquote.rs index f3c7de97865..1a7ae69e79d 100644 --- a/src/libsyntax/ext/qquote.rs +++ b/src/libsyntax/ext/qquote.rs @@ -212,7 +212,7 @@ fn finish state = skip(str::char_len(repl)); str2 += repl; } - alt state { + alt copy state { active {str::push_char(str2, ch);} skip(1u) {state = blank;} skip(sk) {state = skip (sk-1u);} diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index cb92aad04c7..bbbd09632ef 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -184,16 +184,16 @@ fn is_lit(t: token::token) -> bool { } } -fn is_ident(t: token::token) -> bool { +pure fn is_ident(t: token::token) -> bool { alt t { token::IDENT(_, _) { ret true; } _ { } } ret false; } -fn is_plain_ident(t: token::token) -> bool { +pure fn is_plain_ident(t: token::token) -> bool { ret alt t { token::IDENT(_, false) { true } _ { false } }; } -fn is_bar(t: token::token) -> bool { +pure fn is_bar(t: token::token) -> bool { alt t { token::BINOP(token::OR) | token::OROR { true } _ { false } } }