Skip to content

Commit cb57fc4

Browse files
committed
---
yaml --- r: 50127 b: refs/heads/auto c: d700500 h: refs/heads/master i: 50125: 637fd46 50123: 47e30f8 50119: e39b99f 50111: db24095 v: v3
1 parent c6d3f95 commit cb57fc4

File tree

84 files changed

+343
-407
lines changed

Some content is hidden

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

84 files changed

+343
-407
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: f8323397aa3c7358d3c2d3fb62038768b26bfdad
17+
refs/heads/auto: d700500d0cc506f34dccdb8379cc1102becfd24f
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use core::prelude::*;
1212

13-
#[deriving_eq]
13+
#[deriving(Eq)]
1414
pub enum mode {
1515
mode_compile_fail,
1616
mode_run_fail,

branches/auto/src/compiletest/runtest.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn run_debuginfo_test(config: config, props: TestProps, testfile: &Path) {
267267
// check if each line in props.check_lines appears in the
268268
// output (in order)
269269
let mut i = 0u;
270-
for str::lines_each(ProcRes.stdout) |line| {
270+
for str::lines(ProcRes.stdout).each |line| {
271271
if props.check_lines[i].trim() == line.trim() {
272272
i += 1u;
273273
}
@@ -297,8 +297,8 @@ fn check_error_patterns(props: TestProps,
297297
let mut next_err_idx = 0u;
298298
let mut next_err_pat = props.error_patterns[next_err_idx];
299299
let mut done = false;
300-
for str::lines_each(ProcRes.stderr) |line| {
301-
if str::contains(line, next_err_pat) {
300+
for str::split_char(ProcRes.stderr, '\n').each |line| {
301+
if str::contains(*line, next_err_pat) {
302302
debug!("found error pattern %s", next_err_pat);
303303
next_err_idx += 1u;
304304
if next_err_idx == vec::len(props.error_patterns) {
@@ -347,15 +347,15 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
347347
// filename:line1:col1: line2:col2: *warning:* msg
348348
// where line1:col1: is the starting point, line2:col2:
349349
// is the ending point, and * represents ANSI color codes.
350-
for str::lines_each(ProcRes.stderr) |line| {
350+
for str::split_char(ProcRes.stderr, '\n').each |line| {
351351
let mut was_expected = false;
352352
for vec::eachi(expected_errors) |i, ee| {
353353
if !found_flags[i] {
354354
debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
355-
prefixes[i], ee.kind, ee.msg, line);
356-
if (str::starts_with(line, prefixes[i]) &&
357-
str::contains(line, ee.kind) &&
358-
str::contains(line, ee.msg)) {
355+
prefixes[i], ee.kind, ee.msg, *line);
356+
if (str::starts_with(*line, prefixes[i]) &&
357+
str::contains(*line, ee.kind) &&
358+
str::contains(*line, ee.msg)) {
359359
found_flags[i] = true;
360360
was_expected = true;
361361
break;
@@ -364,13 +364,13 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
364364
}
365365

366366
// ignore this msg which gets printed at the end
367-
if str::contains(line, ~"aborting due to") {
367+
if str::contains(*line, ~"aborting due to") {
368368
was_expected = true;
369369
}
370370

371-
if !was_expected && is_compiler_error_or_warning(str::from_slice(line)) {
371+
if !was_expected && is_compiler_error_or_warning(*line) {
372372
fatal_ProcRes(fmt!("unexpected compiler error or warning: '%s'",
373-
line),
373+
*line),
374374
ProcRes);
375375
}
376376
}

branches/auto/src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub trait Eq {
3737
pure fn ne(&self, other: &Self) -> bool;
3838
}
3939

40-
#[deriving_eq]
40+
#[deriving(Eq)]
4141
pub enum Ordering { Less, Equal, Greater }
4242

4343
/// Trait for types that form a total order

branches/auto/src/libcore/either.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use result;
1717
use vec;
1818

1919
/// The either type
20-
#[deriving_eq]
20+
#[deriving(Eq)]
2121
pub enum Either<T, U> {
2222
Left(T),
2323
Right(U)

branches/auto/src/libcore/io.rs

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ pub trait ReaderUtil {
9999
/// Read len bytes into a new vec.
100100
fn read_bytes(&self, len: uint) -> ~[u8];
101101

102-
/// Read up until a specified character (which is optionally included) or EOF.
103-
fn read_until(&self, c: char, include: bool) -> ~str;
102+
/// Read up until a specified character (which is not returned) or EOF.
103+
fn read_until(&self, c: char) -> ~str;
104104

105105
/// Read up until the first '\n' char (which is not returned), or EOF.
106106
fn read_line(&self) -> ~str;
@@ -126,9 +126,6 @@ pub trait ReaderUtil {
126126
/// Iterate over every line until the iterator breaks or EOF.
127127
fn each_line(&self, it: &fn(&str) -> bool);
128128

129-
/// Read all the lines of the file into a vector.
130-
fn read_lines(&self) -> ~[~str];
131-
132129
/// Read n (between 1 and 8) little-endian unsigned integer bytes.
133130
fn read_le_uint_n(&self, nbytes: uint) -> u64;
134131

@@ -222,14 +219,11 @@ impl<T:Reader> ReaderUtil for T {
222219
bytes
223220
}
224221

225-
fn read_until(&self, c: char, include: bool) -> ~str {
222+
fn read_until(&self, c: char) -> ~str {
226223
let mut bytes = ~[];
227224
loop {
228225
let ch = self.read_byte();
229226
if ch == -1 || ch == c as int {
230-
if include && ch == c as int {
231-
bytes.push(ch as u8);
232-
}
233227
break;
234228
}
235229
bytes.push(ch as u8);
@@ -238,7 +232,7 @@ impl<T:Reader> ReaderUtil for T {
238232
}
239233

240234
fn read_line(&self) -> ~str {
241-
self.read_until('\n', false)
235+
self.read_until('\n')
242236
}
243237

244238
fn read_chars(&self, n: uint) -> ~[char] {
@@ -312,7 +306,7 @@ impl<T:Reader> ReaderUtil for T {
312306
}
313307

314308
fn read_c_str(&self) -> ~str {
315-
self.read_until(0 as char, false)
309+
self.read_until(0 as char)
316310
}
317311

318312
fn read_whole_stream(&self) -> ~[u8] {
@@ -335,29 +329,7 @@ impl<T:Reader> ReaderUtil for T {
335329

336330
fn each_line(&self, it: &fn(s: &str) -> bool) {
337331
while !self.eof() {
338-
// include the \n, so that we can distinguish an entirely empty
339-
// line read after "...\n", and the trailing empty line in
340-
// "...\n\n".
341-
let mut line = self.read_until('\n', true);
342-
343-
// blank line at the end of the reader is ignored
344-
if self.eof() && line.is_empty() { break; }
345-
346-
// trim the \n, so that each_line is consistent with read_line
347-
let n = str::len(line);
348-
if line[n-1] == '\n' as u8 {
349-
unsafe { str::raw::set_len(&mut line, n-1); }
350-
}
351-
352-
if !it(line) { break; }
353-
}
354-
}
355-
356-
fn read_lines(&self) -> ~[~str] {
357-
do vec::build |push| {
358-
for self.each_line |line| {
359-
push(str::from_slice(line));
360-
}
332+
if !it(self.read_line()) { break; }
361333
}
362334
}
363335

@@ -658,7 +630,7 @@ pub pure fn with_str_reader<T>(s: &str, f: &fn(@Reader) -> T) -> T {
658630
pub enum FileFlag { Append, Create, Truncate, NoFlag, }
659631
660632
// What type of writer are we?
661-
#[deriving_eq]
633+
#[deriving(Eq)]
662634
pub enum WriterType { Screen, File }
663635
664636
// FIXME (#2004): Seekable really should be orthogonal.
@@ -1363,21 +1335,6 @@ mod tests {
13631335
}
13641336
}
13651337
1366-
#[test]
1367-
fn test_read_lines() {
1368-
do io::with_str_reader(~"a\nb\nc\n") |inp| {
1369-
fail_unless!(inp.read_lines() == ~[~"a", ~"b", ~"c"]);
1370-
}
1371-
1372-
do io::with_str_reader(~"a\nb\nc") |inp| {
1373-
fail_unless!(inp.read_lines() == ~[~"a", ~"b", ~"c"]);
1374-
}
1375-
1376-
do io::with_str_reader(~"") |inp| {
1377-
fail_unless!(inp.read_lines().is_empty());
1378-
}
1379-
}
1380-
13811338
#[test]
13821339
fn test_readchars_wide() {
13831340
let wide_test = ~"生锈的汤匙切肉汤hello生锈的汤匙切肉汤";

branches/auto/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use iter::{BaseIter, MutableIter};
5252
#[cfg(test)] use str;
5353

5454
/// The option type
55-
#[deriving_eq]
55+
#[deriving(Eq)]
5656
pub enum Option<T> {
5757
None,
5858
Some(T),

branches/auto/src/libcore/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use option::{None, Option, Some};
2020
use str;
2121
use to_str::ToStr;
2222

23-
#[deriving_eq]
23+
#[deriving(Eq)]
2424
pub struct WindowsPath {
2525
host: Option<~str>,
2626
device: Option<~str>,
@@ -32,7 +32,7 @@ pub pure fn WindowsPath(s: &str) -> WindowsPath {
3232
GenericPath::from_str(s)
3333
}
3434

35-
#[deriving_eq]
35+
#[deriving(Eq)]
3636
pub struct PosixPath {
3737
is_absolute: bool,
3838
components: ~[~str],

branches/auto/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use option::{None, Option, Some};
2020
use vec;
2121

2222
/// The result type
23-
#[deriving_eq]
23+
#[deriving(Eq)]
2424
pub enum Result<T, U> {
2525
/// Contains the successful result value
2626
Ok(T),

0 commit comments

Comments
 (0)