Skip to content

Commit bede54b

Browse files
committed
misc. copies in core/syntax to please borrowck
1 parent ef32ffd commit bede54b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/libcore/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn get<A:copy>(future: future<A>) -> A {
108108
fn with<A,B>(future: future<A>, blk: fn(A) -> B) -> B {
109109
#[doc = "Work with the value without copying it"];
110110

111-
let v = alt future.v {
111+
let v = alt copy future.v {
112112
either::left(v) { v }
113113
either::right(f) {
114114
let v = @f();

src/libcore/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ impl of writer for mem_buffer {
613613
// FIXME #2004--use memcpy here?
614614
let mut pos = self.pos, vpos = 0u;
615615
while vpos < vlen && pos < buf_len {
616-
self.buf.set_elt(pos, v[vpos]);
616+
self.buf.set_elt(pos, copy v[vpos]);
617617
pos += 1u;
618618
vpos += 1u;
619619
}

src/libsyntax/ext/qquote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ fn finish<T: qq_helper>
212212
state = skip(str::char_len(repl));
213213
str2 += repl;
214214
}
215-
alt state {
215+
alt copy state {
216216
active {str::push_char(str2, ch);}
217217
skip(1u) {state = blank;}
218218
skip(sk) {state = skip (sk-1u);}

src/libsyntax/parse/token.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ fn is_lit(t: token::token) -> bool {
184184
}
185185
}
186186

187-
fn is_ident(t: token::token) -> bool {
187+
pure fn is_ident(t: token::token) -> bool {
188188
alt t { token::IDENT(_, _) { ret true; } _ { } }
189189
ret false;
190190
}
191191

192-
fn is_plain_ident(t: token::token) -> bool {
192+
pure fn is_plain_ident(t: token::token) -> bool {
193193
ret alt t { token::IDENT(_, false) { true } _ { false } };
194194
}
195195

196-
fn is_bar(t: token::token) -> bool {
196+
pure fn is_bar(t: token::token) -> bool {
197197
alt t { token::BINOP(token::OR) | token::OROR { true } _ { false } }
198198
}
199199

0 commit comments

Comments
 (0)