about summary refs log tree commit diff
path: root/src/compiletest/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiletest/errors.rs')
-rw-r--r--src/compiletest/errors.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs
index 4fee64e6304..8dfde741104 100644
--- a/src/compiletest/errors.rs
+++ b/src/compiletest/errors.rs
@@ -9,13 +9,14 @@
 // except according to those terms.
 
 use std::io::{BufferedReader, File};
+use std::vec_ng::Vec;
 
 pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
 
 // Load any test directives embedded in the file
-pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
+pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
 
-    let mut error_patterns = ~[];
+    let mut error_patterns = Vec::new();
     let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
     let mut line_num = 1u;
     for ln in rdr.lines() {
@@ -25,12 +26,12 @@ pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
     return error_patterns;
 }
 
-fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
+fn parse_expected(line_num: uint, line: ~str) -> Vec<ExpectedError> {
     let line = line.trim();
     let error_tag = ~"//~";
     let mut idx;
     match line.find_str(error_tag) {
-      None => return ~[],
+      None => return Vec::new(),
       Some(nn) => { idx = (nn as uint) + error_tag.len(); }
     }
 
@@ -57,6 +58,6 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
 
     debug!("line={} kind={} msg={}", line_num - adjust_line, kind, msg);
 
-    return ~[ExpectedError{line: line_num - adjust_line, kind: kind,
-                           msg: msg}];
+    return vec!(ExpectedError{line: line_num - adjust_line, kind: kind,
+                           msg: msg});
 }