diff --git a/src/test/run-pass-fulldeps/deprecated-derive.rs b/src/test/run-pass-fulldeps/deprecated-derive.rs index 69a7f888bbe09..be2a45ca79abd 100644 --- a/src/test/run-pass-fulldeps/deprecated-derive.rs +++ b/src/test/run-pass-fulldeps/deprecated-derive.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(rustc_private)] +#![allow(dead_code)] extern crate serialize; diff --git a/src/test/run-pass-fulldeps/lint-group-plugin.rs b/src/test/run-pass-fulldeps/lint-group-plugin.rs index 1a639cdb9ddfa..21942b84bff9c 100644 --- a/src/test/run-pass-fulldeps/lint-group-plugin.rs +++ b/src/test/run-pass-fulldeps/lint-group-plugin.rs @@ -14,6 +14,7 @@ #![feature(plugin)] #![plugin(lint_group_plugin_test)] +#![allow(dead_code)] fn lintme() { } //~ WARNING item is named 'lintme' fn pleaselintme() { } //~ WARNING item is named 'pleaselintme' diff --git a/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs index 1af26094f2315..2a6daa5040b71 100644 --- a/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs +++ b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs @@ -13,6 +13,8 @@ // ignore-pretty: Random space appears with the pretty test // compile-flags: -Z extra-plugins=lint_plugin_test +#![allow(dead_code)] + fn lintme() { } //~ WARNING item is named 'lintme' #[allow(test_lint)] diff --git a/src/test/run-pass-fulldeps/lint-plugin.rs b/src/test/run-pass-fulldeps/lint-plugin.rs index 8311e188f9229..b694a1c332079 100644 --- a/src/test/run-pass-fulldeps/lint-plugin.rs +++ b/src/test/run-pass-fulldeps/lint-plugin.rs @@ -14,6 +14,7 @@ #![feature(plugin)] #![plugin(lint_plugin_test)] +#![allow(dead_code)] fn lintme() { } //~ WARNING item is named 'lintme' diff --git a/src/test/run-pass/attr-before-view-item.rs b/src/test/run-pass/attr-before-view-item.rs index cdd1b96de1e60..2a86489c69aa5 100644 --- a/src/test/run-pass/attr-before-view-item.rs +++ b/src/test/run-pass/attr-before-view-item.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:expected item - // pretty-expanded FIXME #23616 #![feature(custom_attribute, test)] diff --git a/src/test/run-pass/attr-before-view-item2.rs b/src/test/run-pass/attr-before-view-item2.rs index cd02b5a9e7310..c8683f2d14751 100644 --- a/src/test/run-pass/attr-before-view-item2.rs +++ b/src/test/run-pass/attr-before-view-item2.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:expected item - // pretty-expanded FIXME #23616 #![feature(custom_attribute, test)] diff --git a/src/test/run-pass/deriving-meta-empty-trait-list.rs b/src/test/run-pass/deriving-meta-empty-trait-list.rs index 5b55ef6333534..ff513325d5e68 100644 --- a/src/test/run-pass/deriving-meta-empty-trait-list.rs +++ b/src/test/run-pass/deriving-meta-empty-trait-list.rs @@ -10,6 +10,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![allow(dead_code)] #[derive] //~ WARNING empty trait list in `derive` struct Foo; diff --git a/src/test/run-pass/enum-size-variance.rs b/src/test/run-pass/enum-size-variance.rs index 0bf5df5d61021..21996c5fabf1a 100644 --- a/src/test/run-pass/enum-size-variance.rs +++ b/src/test/run-pass/enum-size-variance.rs @@ -10,7 +10,7 @@ // // ignore-pretty -#![deny(enum_size_variance)] +#![warn(variant_size_differences)] #![allow(dead_code)] enum Enum1 { } @@ -21,8 +21,8 @@ enum Enum3 { D(isize), E, F } enum Enum4 { H(isize), I(isize), J } -enum Enum5 { //~ ERROR three times larger - L(isize, isize, isize, isize), //~ NOTE this variant is the largest +enum Enum5 { + L(isize, isize, isize, isize), //~ WARNING three times larger M(isize), N } @@ -33,7 +33,7 @@ enum Enum6 { Q(isize) } -#[allow(enum_size_variance)] +#[allow(variant_size_differences)] enum Enum7 { R(isize, isize, isize, isize), S(isize), diff --git a/src/test/run-pass/issue-19100.rs b/src/test/run-pass/issue-19100.rs index 0fd4b4394dc27..7ff9ae996f525 100644 --- a/src/test/run-pass/issue-19100.rs +++ b/src/test/run-pass/issue-19100.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![allow(non_snake_case)] +#![allow(dead_code)] +#![allow(unused_variables)] + #[derive(Copy, Clone)] enum Foo { Bar, diff --git a/src/test/run-pass/issue-25757.rs b/src/test/run-pass/issue-25757.rs index 8deb2e244ae08..d1fb75377050d 100644 --- a/src/test/run-pass/issue-25757.rs +++ b/src/test/run-pass/issue-25757.rs @@ -22,6 +22,6 @@ const FUNC: &'static Fn(&mut Foo) -> () = &Foo::x; fn main() { let mut foo = Foo { a: 137 }; - FUNC(&mut foo); //~ ERROR bad + FUNC(&mut foo); assert_eq!(foo.a, 5); } diff --git a/src/test/run-pass/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs index 242528dcb1474..e223d3412e049 100644 --- a/src/test/run-pass/issue-2611-3.rs +++ b/src/test/run-pass/issue-2611-3.rs @@ -22,7 +22,6 @@ struct E { impl A for E { fn b(&self, _x: F) -> F { panic!() } - //~^ ERROR in method `b`, type parameter 0 has 1 bound, but } pub fn main() {} diff --git a/src/test/run-pass/issue-27320.rs b/src/test/run-pass/issue-27320.rs index dde1d3bfe9389..e010b162cc406 100644 --- a/src/test/run-pass/issue-27320.rs +++ b/src/test/run-pass/issue-27320.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![allow(unused_variables)] +#![allow(dead_code)] + macro_rules! piece( ($piece:pat) => ($piece); ); diff --git a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs index 6fc15478f7a55..76b44832a8a16 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs @@ -10,13 +10,13 @@ // pretty-expanded FIXME #23616 -#![allow(unreachable_code)] +#![allow(dead_code)] fn test() { let _v: isize; _v = 1; return; - _v = 2; //~ WARNING: unreachable statement + _v = 2; } pub fn main() { diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 189c5cdb9b747..6448056fb11f4 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -9,14 +9,14 @@ // except according to those terms. -#![allow(unreachable_code)] #![allow(unused_variables)] +#![allow(dead_code)] fn id(x: bool) -> bool { x } fn call_id() { let c = panic!(); - id(c); //~ WARNING unreachable statement + id(c); } fn call_id_3() { id(return) && id(return); } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 0d081b267bb70..60a0d8f0b865f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -197,6 +197,11 @@ impl<'test> TestCx<'test> { self.fatal_proc_rec("compilation failed!", &proc_res); } + let expected_errors = errors::load_errors(&self.testpaths.file, self.revision); + if !expected_errors.is_empty() { + self.check_expected_errors(expected_errors, &proc_res); + } + let proc_res = self.exec_compiled_test(); if !proc_res.status.success() { @@ -992,7 +997,8 @@ actual:\n\ fn check_expected_errors(&self, expected_errors: Vec, proc_res: &ProcRes) { - if proc_res.status.success() { + if proc_res.status.success() && + expected_errors.iter().any(|x| x.kind == Some(ErrorKind::Error)) { self.fatal_proc_rec("process did not return an error status", proc_res); } @@ -1320,6 +1326,7 @@ actual:\n\ match self.config.mode { CompileFail | ParseFail | + RunPass | Incremental => { // If we are extracting and matching errors in the new // fashion, then you want JSON mode. Old-skool error @@ -1350,7 +1357,6 @@ actual:\n\ args.push(dir_opt); } RunFail | - RunPass | RunPassValgrind | Pretty | DebugInfoGdb |