Skip to content

Commit 21e20aa

Browse files
committed
---
yaml --- r: 30459 b: refs/heads/incoming c: f2d9d0b h: refs/heads/master i: 30457: 60f58a7 30455: 50b8997 v: v3
1 parent 4ab6e96 commit 21e20aa

File tree

10 files changed

+55
-55
lines changed

10 files changed

+55
-55
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 93d3b8aa6b681a8add60e4a22a5c41e7f7ce7557
9+
refs/heads/incoming: f2d9d0ba41486924538b28511d60b713b6686f7b
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/extfmt.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,35 +88,35 @@ mod ct {
8888
let lim = str::len(s);
8989
let mut buf = ~"";
9090
fn flush_buf(+buf: ~str, &pieces: ~[piece]) -> ~str {
91-
if str::len(buf) > 0u {
92-
let piece = piece_string(buf);
93-
vec::push(pieces, piece);
91+
if str::len(buf) > 0 {
92+
let piece = piece_string(move buf);
93+
vec::push(pieces, move piece);
9494
}
9595
return ~"";
9696
}
97-
let mut i = 0u;
97+
let mut i = 0;
9898
while i < lim {
9999
let size = str::utf8_char_width(s[i]);
100100
let curr = str::slice(s, i, i+size);
101101
if curr == ~"%" {
102-
i += 1u;
102+
i += 1;
103103
if i >= lim {
104104
error(~"unterminated conversion at end of string");
105105
}
106-
let curr2 = str::slice(s, i, i+1u);
106+
let curr2 = str::slice(s, i, i+1);
107107
if curr2 == ~"%" {
108108
buf += curr2;
109-
i += 1u;
109+
i += 1;
110110
} else {
111-
buf = flush_buf(buf, pieces);
111+
buf = flush_buf(move buf, pieces);
112112
let rs = parse_conversion(s, i, lim, error);
113113
vec::push(pieces, copy rs.piece);
114114
i = rs.next;
115115
}
116116
} else { buf += curr; i += size; }
117117
}
118-
flush_buf(buf, pieces);
119-
return pieces;
118+
flush_buf(move buf, pieces);
119+
move pieces
120120
}
121121
fn peek_num(s: ~str, i: uint, lim: uint) ->
122122
Option<{num: uint, next: uint}> {
@@ -173,7 +173,7 @@ mod ct {
173173
fn parse_flags(s: ~str, i: uint, lim: uint) ->
174174
{flags: ~[flag], next: uint} {
175175
let noflags: ~[flag] = ~[];
176-
if i >= lim { return {flags: noflags, next: i}; }
176+
if i >= lim { return {flags: move noflags, next: i}; }
177177
178178
fn more_(f: flag, s: ~str, i: uint, lim: uint) ->
179179
{flags: ~[flag], next: uint} {
@@ -376,7 +376,7 @@ mod rt {
376376
let diff = prec - len;
377377
let pad = str::from_chars(vec::from_elem(diff, '0'));
378378
pad + s
379-
} else { s }
379+
} else { move s }
380380
};
381381
}
382382
pure fn get_int_precision(cv: conv) -> uint {

branches/incoming/src/libcore/flate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn deflate_buf(buf: &[const u8]) -> ~[u8] {
3131
let out = vec::unsafe::from_buf(res as *u8,
3232
outsz as uint);
3333
libc::free(res);
34-
out
34+
move out
3535
}
3636
}
3737
}
@@ -49,7 +49,7 @@ fn inflate_buf(buf: &[const u8]) -> ~[u8] {
4949
let out = vec::unsafe::from_buf(res as *u8,
5050
outsz as uint);
5151
libc::free(res);
52-
out
52+
move out
5353
}
5454
}
5555
}

branches/incoming/src/libcore/io.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<T: Reader> T : ReaderUtil {
5858
let count = self.read(buf, len);
5959

6060
unsafe { vec::unsafe::set_len(buf, count); }
61-
vec::from_mut(buf)
61+
vec::from_mut(move buf)
6262
}
6363
fn read_line() -> ~str {
6464
let mut buf = ~[];
@@ -128,7 +128,7 @@ impl Reader {
128128
buf = vec::slice(buf, offset, vec::len(buf));
129129
}
130130
}
131-
chars
131+
move chars
132132
}
133133

134134
fn read_char() -> char {
@@ -180,7 +180,7 @@ impl Reader {
180180
fn read_whole_stream() -> ~[u8] {
181181
let mut buf: ~[u8] = ~[];
182182
while !self.eof() { vec::push_all(buf, self.read_bytes(2048u)); }
183-
buf
183+
move buf
184184
}
185185

186186
fn each_byte(it: fn(int) -> bool) {
@@ -688,7 +688,7 @@ impl MemBuffer: Writer {
688688
689689
self.pos += v_len;
690690
691-
buf
691+
move buf
692692
}
693693
}
694694
fn seek(offset: int, whence: SeekStyle) {

branches/incoming/src/libcore/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ mod global_env {
215215
assert vec::len(vs) == 2u;
216216
vec::push(pairs, (copy vs[0], copy vs[1]));
217217
}
218-
return pairs;
218+
move pairs
219219
}
220220

221221
#[cfg(unix)]

branches/incoming/src/libcore/path.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl PosixPath : GenericPath {
9999
if s.len() == 0 {
100100
~"."
101101
} else {
102-
s
102+
move s
103103
}
104104
}
105105
}
@@ -139,7 +139,7 @@ impl PosixPath : GenericPath {
139139
let dpath = from_str::<PosixPath>(d);
140140
match self.filename() {
141141
Some(ref f) => dpath.push(*f),
142-
None => dpath
142+
None => move dpath
143143
}
144144
}
145145

@@ -197,8 +197,7 @@ impl PosixPath : GenericPath {
197197
}
198198

199199
pure fn push_many(cs: &[~str]) -> PosixPath {
200-
return PosixPath { components: self.components + cs,
201-
..self }
200+
PosixPath { components: (copy self.components) + copy cs, ..self }
202201
}
203202

204203
pure fn push(s: &str) -> PosixPath {
@@ -288,7 +287,7 @@ impl WindowsPath : GenericPath {
288287
if s.len() == 0 {
289288
~"."
290289
} else {
291-
s
290+
move s
292291
}
293292
}
294293
}
@@ -328,7 +327,7 @@ impl WindowsPath : GenericPath {
328327
let dpath = from_str::<WindowsPath>(d);
329328
match self.filename() {
330329
Some(ref f) => dpath.push(*f),
331-
None => dpath
330+
None => move dpath
332331
}
333332
}
334333

@@ -386,7 +385,7 @@ impl WindowsPath : GenericPath {
386385
}
387386

388387
pure fn push_many(cs: &[~str]) -> WindowsPath {
389-
return WindowsPath { components: self.components + cs,
388+
return WindowsPath { components: (copy self.components) + (copy cs),
390389
..self }
391390
}
392391

@@ -428,7 +427,7 @@ pure fn normalize(components: &[~str]) -> ~[~str] {
428427
}
429428
}
430429
}
431-
cs
430+
move cs
432431
}
433432
434433
mod posix {
@@ -525,7 +524,7 @@ mod windows {
525524
if s[i] == '\\' as u8 {
526525
let pre = s.slice(2, i);
527526
let rest = s.slice(i, s.len());
528-
return Some((pre, rest));
527+
return Some((move pre, move rest));
529528
}
530529
i += 1;
531530
}
@@ -543,7 +542,7 @@ mod windows {
543542
} else {
544543
s.slice(2, s.len())
545544
};
546-
return Some((s.slice(0,1), rest));
545+
return Some((s.slice(0,1), move rest));
547546
}
548547
None
549548
}

branches/incoming/src/libcore/priv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ unsafe fn chan_from_global_ptr<T: Send>(
4646
// There's no global channel. We must make it
4747
4848
let (setup_po, setup_ch) = do task_fn().spawn_conversation
49-
|setup_po, setup_ch| {
49+
|move f, setup_po, setup_ch| {
5050
let po = comm::Port::<T>();
5151
let ch = comm::Chan(po);
5252
comm::send(setup_ch, ch);
5353
5454
// Wait to hear if we are the official instance of
5555
// this global task
5656
match comm::recv::<Msg>(setup_po) {
57-
Proceed => f(po),
57+
Proceed => f(move po),
5858
Abort => ()
5959
}
6060
};

branches/incoming/src/libcore/rand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl Rng {
154154
s = s + str::from_char(self.gen_char_from(charset));
155155
i += 1u;
156156
}
157-
s
157+
move s
158158
}
159159

160160
/// Return a random byte string of the specified length
@@ -220,14 +220,14 @@ impl Rng {
220220
vec::push(r, item.item);
221221
}
222222
}
223-
r
223+
move r
224224
}
225225

226226
/// Shuffle a vec
227227
fn shuffle<T:Copy>(values: &[T]) -> ~[T] {
228228
let mut m = vec::from_slice(values);
229229
self.shuffle_mut(m);
230-
return m;
230+
move m
231231
}
232232

233233
/// Shuffle a mutable vec in place

branches/incoming/src/libcore/run.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fn read_all(rd: io::Reader) -> ~str {
260260
let bytes = rd.read_bytes(4096u);
261261
buf += str::from_bytes(bytes);
262262
}
263-
return buf;
263+
move buf
264264
}
265265

266266
/**
@@ -306,11 +306,11 @@ fn program_output(prog: &str, args: &[~str]) ->
306306
let ch = comm::Chan(p);
307307
do task::spawn_sched(task::SingleThreaded) {
308308
let errput = readclose(pipe_err.in);
309-
comm::send(ch, (2, errput));
309+
comm::send(ch, (2, move errput));
310310
};
311311
do task::spawn_sched(task::SingleThreaded) {
312312
let output = readclose(pipe_out.in);
313-
comm::send(ch, (1, output));
313+
comm::send(ch, (1, move output));
314314
};
315315
let status = run::waitpid(pid);
316316
let mut errs = ~"";
@@ -332,7 +332,7 @@ fn program_output(prog: &str, args: &[~str]) ->
332332
};
333333
count -= 1;
334334
};
335-
return {status: status, out: outs, err: errs};
335+
return {status: status, out: move outs, err: move errs};
336336
}
337337

338338
fn writeclose(fd: c_int, s: &str) {
@@ -354,7 +354,7 @@ fn readclose(fd: c_int) -> ~str {
354354
buf += str::from_bytes(bytes);
355355
}
356356
os::fclose(file);
357-
return buf;
357+
move buf
358358
}
359359

360360
/// Waits for a process to exit and returns the exit code

0 commit comments

Comments
 (0)