Skip to content

Commit 289001f

Browse files
committed
---
yaml --- r: 50844 b: refs/heads/try c: f36f9fc h: refs/heads/master v: v3
1 parent 8b4d1af commit 289001f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1273
-1277
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 87d9316793d2bd1313ebf51c46bd02f06227044c
5+
refs/heads/try: f36f9fc91ccc86c7004979689da981184559e57a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
5151
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
5252
let start_kind = idx;
5353
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
54-
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());
54+
let kind = str::to_lower(str::slice(line, start_kind, idx));
5555

5656
// Extract msg:
5757
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
58-
let msg = str::slice(line, idx, len).to_owned();
58+
let msg = str::slice(line, idx, len);
5959

6060
debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
6161

branches/try/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn parse_name_value_directive(line: ~str,
175175
match str::find_str(line, keycolon) {
176176
Some(colon) => {
177177
let value = str::slice(line, colon + str::len(keycolon),
178-
str::len(line)).to_owned();
178+
str::len(line));
179179
debug!("%s: %s", directive, value);
180180
Some(value)
181181
}

branches/try/src/etc/x86.supp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,6 @@
451451
fun:*uv_loop_delete*
452452
}
453453

454-
{
455-
race-or-something-ask-pcwalton-0
456-
Memcheck:Value4
457-
fun:*task_start_wrapper*
458-
...
459-
}
460-
461-
{
462-
race-or-something-ask-pcwalton-1
463-
Memcheck:Value4
464-
...
465-
fun:*build_start_wrapper*
466-
...
467-
}
468-
469454
{
470455
lock_and_signal-probably-threadsafe-access-outside-of-lock
471456
Helgrind:Race

branches/try/src/libcore/comm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ pub fn stream<T:Owned>() -> (Port<T>, Chan<T>) {
110110
// required.
111111
#[cfg(stage1)]
112112
#[cfg(stage2)]
113-
#[cfg(stage3)]
114113
pub impl<T: Owned> Chan<T> {
115114
fn send(&self, x: T) { chan_send(self, x) }
116115
fn try_send(&self, x: T) -> bool { chan_try_send(self, x) }
@@ -150,7 +149,6 @@ fn chan_try_send<T:Owned>(self: &Chan<T>, x: T) -> bool {
150149
// Use an inherent impl so that imports are not required:
151150
#[cfg(stage1)]
152151
#[cfg(stage2)]
153-
#[cfg(stage3)]
154152
pub impl<T: Owned> Port<T> {
155153
fn recv(&self) -> T { port_recv(self) }
156154
fn try_recv(&self) -> Option<T> { port_try_recv(self) }
@@ -228,7 +226,6 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
228226
// Use an inherent impl so that imports are not required:
229227
#[cfg(stage1)]
230228
#[cfg(stage2)]
231-
#[cfg(stage3)]
232229
pub impl<T:Owned> PortSet<T> {
233230
fn recv(&self) -> T { port_set_recv(self) }
234231
fn try_recv(&self) -> Option<T> { port_set_try_recv(self) }
@@ -304,7 +301,6 @@ pub type SharedChan<T> = unstable::Exclusive<Chan<T>>;
304301
305302
#[cfg(stage1)]
306303
#[cfg(stage2)]
307-
#[cfg(stage3)]
308304
pub impl<T: Owned> SharedChan<T> {
309305
fn send(&self, x: T) { shared_chan_send(self, x) }
310306
fn try_send(&self, x: T) -> bool { shared_chan_try_send(self, x) }

branches/try/src/libcore/io.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ use libc;
2121
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
2222
use libc::consts::os::posix88::*;
2323
use os;
24-
use cast;
25-
use path::Path;
26-
use ops::Drop;
24+
use prelude::*;
2725
use ptr;
2826
use result;
2927
use str;
@@ -77,7 +75,6 @@ pub trait Reader {
7775

7876
#[cfg(stage1)]
7977
#[cfg(stage2)]
80-
#[cfg(stage3)]
8178
impl Reader for @Reader {
8279
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
8380
self.read(bytes, len)
@@ -660,7 +657,6 @@ pub trait Writer {
660657
661658
#[cfg(stage1)]
662659
#[cfg(stage2)]
663-
#[cfg(stage3)]
664660
impl Writer for @Writer {
665661
fn write(&self, v: &[const u8]) { self.write(v) }
666662
fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) }
@@ -990,7 +986,7 @@ pub trait WriterUtil {
990986

991987
impl<T:Writer> WriterUtil for T {
992988
fn write_char(&self, ch: char) {
993-
if (ch as uint) < 128u {
989+
if ch as uint < 128u {
994990
self.write(&[ch as u8]);
995991
} else {
996992
self.write_str(str::from_char(ch));
@@ -1204,11 +1200,9 @@ pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> {
12041200
// fsync related
12051201

12061202
pub mod fsync {
1203+
use prelude::*;
12071204
use io::{FILERes, FdRes, fd_t};
1208-
use kinds::Copy;
12091205
use libc;
1210-
use ops::Drop;
1211-
use option::{None, Option, Some};
12121206
use os;
12131207

12141208
pub enum Level {

branches/try/src/libcore/libc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ pub mod types {
230230
pub type uintptr_t = uint;
231231
}
232232
pub mod posix88 {
233+
use prelude::*;
234+
233235
pub type off_t = i32;
234236
pub type dev_t = u64;
235237
pub type ino_t = u32;

branches/try/src/libcore/num/strconv.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub pure fn to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+
165165
Div<T,T>+Neg<T>+Modulo<T,T>+Mul<T,T>>(
166166
num: &T, radix: uint, negative_zero: bool,
167167
sign: SignFormat, digits: SignificantDigits) -> (~[u8], bool) {
168-
if (radix as int) < 2 {
168+
if radix as int < 2 {
169169
fail!(fmt!("to_str_bytes_common: radix %? to low, \
170170
must lie in the range [2, 36]", radix));
171171
} else if radix as int > 36 {
@@ -364,14 +364,14 @@ pub pure fn to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+
364364

365365
// only resize buf if we actually remove digits
366366
if i < buf_max_i {
367-
buf = buf.slice(0, i + 1).to_owned();
367+
buf = buf.slice(0, i + 1);
368368
}
369369
}
370370
} // If exact and trailing '.', just cut that
371371
else {
372372
let max_i = buf.len() - 1;
373373
if buf[max_i] == '.' as u8 {
374-
buf = buf.slice(0, max_i).to_owned();
374+
buf = buf.slice(0, max_i);
375375
}
376376
}
377377

@@ -455,10 +455,10 @@ pub pure fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
455455
_ if special && radix >= DIGIT_I_RADIX // first digit of 'inf'
456456
=> fail!(fmt!("from_str_bytes_common: radix %? incompatible with \
457457
special values 'inf' and 'NaN'", radix)),
458-
_ if (radix as int) < 2
458+
_ if radix as int < 2
459459
=> fail!(fmt!("from_str_bytes_common: radix %? to low, \
460460
must lie in the range [2, 36]", radix)),
461-
_ if (radix as int) > 36
461+
_ if radix as int > 36
462462
=> fail!(fmt!("from_str_bytes_common: radix %? to high, \
463463
must lie in the range [2, 36]", radix)),
464464
_ => ()
@@ -606,7 +606,7 @@ pub pure fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
606606
// parse remaining bytes as decimal integer,
607607
// skipping the exponent char
608608
let exp: Option<int> = from_str_bytes_common(
609-
buf.slice(i+1, len), 10, true, false, false, ExpNone, false);
609+
buf.view(i+1, len), 10, true, false, false, ExpNone, false);
610610

611611
match exp {
612612
Some(exp_pow) => {

branches/try/src/libcore/path.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl GenericPath for PosixPath {
410410
None => None,
411411
Some(ref f) => {
412412
match str::rfind_char(*f, '.') {
413-
Some(p) => Some(f.slice(0, p).to_owned()),
413+
Some(p) => Some(f.slice(0, p)),
414414
None => Some(copy *f)
415415
}
416416
}
@@ -422,7 +422,7 @@ impl GenericPath for PosixPath {
422422
None => None,
423423
Some(ref f) => {
424424
match str::rfind_char(*f, '.') {
425-
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
425+
Some(p) if p < f.len() => Some(f.slice(p, f.len())),
426426
_ => None
427427
}
428428
}
@@ -622,7 +622,7 @@ impl GenericPath for WindowsPath {
622622
None => None,
623623
Some(ref f) => {
624624
match str::rfind_char(*f, '.') {
625-
Some(p) => Some(f.slice(0, p).to_owned()),
625+
Some(p) => Some(f.slice(0, p)),
626626
None => Some(copy *f)
627627
}
628628
}
@@ -634,7 +634,7 @@ impl GenericPath for WindowsPath {
634634
None => None,
635635
Some(ref f) => {
636636
match str::rfind_char(*f, '.') {
637-
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
637+
Some(p) if p < f.len() => Some(f.slice(p, f.len())),
638638
_ => None
639639
}
640640
}
@@ -842,8 +842,8 @@ pub mod windows {
842842
let mut i = 2;
843843
while i < s.len() {
844844
if is_sep(s[i]) {
845-
let pre = s.slice(2, i).to_owned();
846-
let mut rest = s.slice(i, s.len()).to_owned();
845+
let pre = s.slice(2, i);
846+
let mut rest = s.slice(i, s.len());
847847
return Some((pre, rest));
848848
}
849849
i += 1;
@@ -860,9 +860,9 @@ pub mod windows {
860860
let rest = if s.len() == 2 {
861861
~""
862862
} else {
863-
s.slice(2, s.len()).to_owned()
863+
s.slice(2, s.len())
864864
};
865-
return Some((s.slice(0,1).to_owned(), rest));
865+
return Some((s.slice(0,1), rest));
866866
}
867867
None
868868
}

branches/try/src/libcore/prelude.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
4343
pub use vec::{CopyableVector, ImmutableVector};
4444
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
4545
pub use vec::{OwnedVector, OwnedCopyableVector};
46-
pub use io::{Reader, ReaderUtil, Writer, WriterUtil};
4746

4847
/* Reexported runtime types */
4948
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};

branches/try/src/libcore/repr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub impl ReprVisitor {
218218

219219
fn write_escaped_slice(&self, slice: &str) {
220220
self.writer.write_char('"');
221-
for slice.each_char |ch| {
221+
for str::chars_each(slice) |ch| {
222222
self.writer.write_escaped_char(ch);
223223
}
224224
self.writer.write_char('"');
@@ -242,7 +242,7 @@ pub impl ReprVisitor {
242242
let (sz, al) = unsafe { ((*inner).size, (*inner).align) };
243243
self.writer.write_char('[');
244244
let mut first = true;
245-
while (p as uint) < (end as uint) {
245+
while p as uint < end as uint {
246246
if first {
247247
first = false;
248248
} else {

branches/try/src/libcore/rt/uv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ fn listen() {
878878
if status.is_none() {
879879
rtdebug!("got %d bytes", nread);
880880
let buf = buf.unwrap();
881-
for buf.slice(0, nread as uint).each |byte| {
881+
for buf.view(0, nread as uint).each |byte| {
882882
fail_unless!(*byte == count as u8);
883883
rtdebug!("%u", *byte as uint);
884884
count += 1;

branches/try/src/libcore/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn read_all(rd: io::Reader) -> ~str {
303303
let mut bytes = [0, ..4096];
304304
while !rd.eof() {
305305
let nread = rd.read(bytes, bytes.len());
306-
wr.write(bytes.slice(0, nread));
306+
wr.write(bytes.view(0, nread));
307307
}
308308
});
309309
str::from_bytes(buf)
@@ -404,7 +404,7 @@ pub fn readclose(fd: c_int) -> ~str {
404404
let mut bytes = [0, ..4096];
405405
while !reader.eof() {
406406
let nread = reader.read(bytes, bytes.len());
407-
writer.write(bytes.slice(0, nread));
407+
writer.write(bytes.view(0, nread));
408408
}
409409
});
410410
os::fclose(file);

0 commit comments

Comments
 (0)