diff options
| author | Palmer Cox <p@lmercox.com> | 2014-02-19 21:53:46 -0500 |
|---|---|---|
| committer | Palmer Cox <p@lmercox.com> | 2014-03-12 22:42:50 -0400 |
| commit | 9ba6bb5a71adeb861f8bf21c2b1f2fde3132480d (patch) | |
| tree | 8b334634887fcd0a6ba5a2ed926aec010386fc05 /src/compiletest | |
| parent | 2eebeb81372e320510a1c1e2eef96eb5146a1e1f (diff) | |
Update io iterators to produce IoResults
Most IO related functions return an IoResult so that the caller can handle failure in whatever way is appropriate. However, the `lines`, `bytes`, and `chars` iterators all supress errors. This means that code that needs to handle errors can't use any of these iterators. All three of these iterators were updated to produce IoResults. Fixes #12368
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/errors.rs | 2 | ||||
| -rw-r--r-- | src/compiletest/header.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 3a6b1666c1e..4fee64e6304 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -19,7 +19,7 @@ pub fn load_errors(testfile: &Path) -> ~[ExpectedError] { let mut rdr = BufferedReader::new(File::open(testfile).unwrap()); let mut line_num = 1u; for ln in rdr.lines() { - error_patterns.push_all_move(parse_expected(line_num, ln)); + error_patterns.push_all_move(parse_expected(line_num, ln.unwrap())); line_num += 1u; } return error_patterns; diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 7f8be5ff090..81b76f6b09a 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -140,6 +140,7 @@ fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool { // Assume that any directives will be found before the first // module or function. This doesn't seem to be an optimization // with a warm page cache. Maybe with a cold one. + let ln = ln.unwrap(); if ln.starts_with("fn") || ln.starts_with("mod") { return true; } else { if !(it(ln.trim())) { return false; } } |
