From 25d0ef347affe79557cdfbaa4e66144c7f476fc0 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Sun, 24 May 2015 14:29:12 +1000 Subject: Improve diagnostic messages for range patterns. --- src/compiletest/runtest.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/compiletest') diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index fef36ec2c2f..87b6f8f0df6 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -24,7 +24,6 @@ use std::fmt; use std::fs::{self, File}; use std::io::BufReader; use std::io::prelude::*; -use std::iter::repeat; use std::net::TcpStream; use std::path::{Path, PathBuf}; use std::process::{Command, Output, ExitStatus}; @@ -928,12 +927,12 @@ fn check_forbid_output(props: &TestProps, } } -fn check_expected_errors(expected_errors: Vec , +fn check_expected_errors(expected_errors: Vec, testfile: &Path, proc_res: &ProcRes) { // true if we found the error in question - let mut found_flags: Vec<_> = repeat(false).take(expected_errors.len()).collect(); + let mut found_flags = vec![false; expected_errors.len()]; if proc_res.status.success() { fatal("process did not return an error status"); @@ -954,14 +953,10 @@ fn check_expected_errors(expected_errors: Vec , } } - // A multi-line error will have followup lines which will always - // start with one of these strings. + // A multi-line error will have followup lines which start with a space + // or open paren. fn continuation( line: &str) -> bool { - line.starts_with(" expected") || - line.starts_with(" found") || - // 1234 - // Should have 4 spaces: see issue 18946 - line.starts_with("(") + line.starts_with(" ") || line.starts_with("(") } // Scan and extract our error/warning messages, -- cgit 1.4.1-3-g733a5