diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-25 22:51:32 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-28 19:41:56 -0800 |
| commit | dd38af240bbce5ca42ae5442730849e4a29698eb (patch) | |
| tree | d4951ceff655d19663a9676d3dc7cff3865df476 /src/compiletest/errors.rs | |
| parent | c5461e46aecbf42a23bdecb4cc3f8320fba2866b (diff) | |
| download | rust-dd38af240bbce5ca42ae5442730849e4a29698eb.tar.gz rust-dd38af240bbce5ca42ae5442730849e4a29698eb.zip | |
compiletest: Allow legacy records
But also remove most uses of structural records.
Diffstat (limited to 'src/compiletest/errors.rs')
| -rw-r--r-- | src/compiletest/errors.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 2a28b767d0a..2dc48118edd 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -16,12 +16,12 @@ use io::ReaderUtil; use str; export load_errors; -export expected_error; +export ExpectedError; -type expected_error = { line: uint, kind: ~str, msg: ~str }; +struct ExpectedError { line: uint, kind: ~str, msg: ~str } // Load any test directives embedded in the file -fn load_errors(testfile: &Path) -> ~[expected_error] { +fn load_errors(testfile: &Path) -> ~[ExpectedError] { let mut error_patterns = ~[]; let rdr = io::file_reader(testfile).get(); let mut line_num = 1u; @@ -33,7 +33,7 @@ fn load_errors(testfile: &Path) -> ~[expected_error] { return error_patterns; } -fn parse_expected(line_num: uint, line: ~str) -> ~[expected_error] { +fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] { unsafe { let error_tag = ~"//~"; let mut idx; @@ -63,6 +63,7 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[expected_error] { debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg); - return ~[{line: line_num - adjust_line, kind: kind, msg: msg}]; + return ~[ExpectedError{line: line_num - adjust_line, kind: kind, + msg: msg}]; } } |
