Skip to content

Commit 934ef13

Browse files
committed
---
yaml --- r: 139783 b: refs/heads/try2 c: 59e69aa h: refs/heads/master i: 139781: 57fb694 139779: 0d6a2ac 139775: 2db0e9c v: v3
1 parent 28cdd98 commit 934ef13

File tree

3 files changed

+34
-38
lines changed

3 files changed

+34
-38
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8978643f92fc8780515d838a9797f9454386618b
8+
refs/heads/try2: 59e69aa0e79302887abcb4b6bf3613c84b48e5d7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/errors.rs

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,34 @@ pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
3030
}
3131

3232
fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
33-
unsafe {
34-
let error_tag = ~"//~";
35-
let mut idx;
36-
match str::find_str(line, error_tag) {
37-
None => return ~[],
38-
Some(nn) => { idx = (nn as uint) + str::len(error_tag); }
39-
}
33+
let error_tag = ~"//~";
34+
let mut idx;
35+
match str::find_str(line, error_tag) {
36+
None => return ~[],
37+
Some(nn) => { idx = (nn as uint) + str::len(error_tag); }
38+
}
4039

41-
// "//~^^^ kind msg" denotes a message expected
42-
// three lines above current line:
43-
let mut adjust_line = 0u;
44-
let len = str::len(line);
45-
while idx < len && line[idx] == ('^' as u8) {
46-
adjust_line += 1u;
47-
idx += 1u;
48-
}
40+
// "//~^^^ kind msg" denotes a message expected
41+
// three lines above current line:
42+
let mut adjust_line = 0u;
43+
let len = str::len(line);
44+
while idx < len && line[idx] == ('^' as u8) {
45+
adjust_line += 1u;
46+
idx += 1u;
47+
}
4948

50-
// Extract kind:
51-
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
52-
let start_kind = idx;
53-
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
54-
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());
49+
// Extract kind:
50+
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
51+
let start_kind = idx;
52+
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
53+
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());
5554

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

60-
debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
59+
debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
6160

62-
return ~[ExpectedError{line: line_num - adjust_line, kind: kind,
63-
msg: msg}];
64-
}
61+
return ~[ExpectedError{line: line_num - adjust_line, kind: kind,
62+
msg: msg}];
6563
}

branches/try2/src/compiletest/header.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,14 @@ fn parse_name_directive(line: ~str, directive: ~str) -> bool {
171171

172172
fn parse_name_value_directive(line: ~str,
173173
directive: ~str) -> Option<~str> {
174-
unsafe {
175-
let keycolon = directive + ~":";
176-
match str::find_str(line, keycolon) {
177-
Some(colon) => {
178-
let value = str::slice(line, colon + str::len(keycolon),
179-
str::len(line)).to_owned();
180-
debug!("%s: %s", directive, value);
181-
Some(value)
182-
}
183-
None => None
174+
let keycolon = directive + ~":";
175+
match str::find_str(line, keycolon) {
176+
Some(colon) => {
177+
let value = str::slice(line, colon + str::len(keycolon),
178+
str::len(line)).to_owned();
179+
debug!("%s: %s", directive, value);
180+
Some(value)
184181
}
182+
None => None
185183
}
186184
}

0 commit comments

Comments
 (0)