Skip to content

Commit a23064a

Browse files
authored
Auto merge of #35674 - ahmedcharles:rpass, r=alexcrichton
Fix compiletest so it respects warnings for run-pass.
2 parents 1194695 + 6961d26 commit a23064a

15 files changed

+30
-16
lines changed

src/test/run-pass-fulldeps/deprecated-derive.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(rustc_private)]
12+
#![allow(dead_code)]
1213

1314
extern crate serialize;
1415

src/test/run-pass-fulldeps/lint-group-plugin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#![feature(plugin)]
1616
#![plugin(lint_group_plugin_test)]
17+
#![allow(dead_code)]
1718

1819
fn lintme() { } //~ WARNING item is named 'lintme'
1920
fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'

src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// ignore-pretty: Random space appears with the pretty test
1414
// compile-flags: -Z extra-plugins=lint_plugin_test
1515

16+
#![allow(dead_code)]
17+
1618
fn lintme() { } //~ WARNING item is named 'lintme'
1719

1820
#[allow(test_lint)]

src/test/run-pass-fulldeps/lint-plugin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#![feature(plugin)]
1616
#![plugin(lint_plugin_test)]
17+
#![allow(dead_code)]
1718

1819
fn lintme() { } //~ WARNING item is named 'lintme'
1920

src/test/run-pass/attr-before-view-item.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:expected item
12-
1311
// pretty-expanded FIXME #23616
1412

1513
#![feature(custom_attribute, test)]

src/test/run-pass/attr-before-view-item2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:expected item
12-
1311
// pretty-expanded FIXME #23616
1412

1513
#![feature(custom_attribute, test)]

src/test/run-pass/deriving-meta-empty-trait-list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// option. This file may not be copied, modified, or distributed
1111
// except according to those terms.
1212

13+
#![allow(dead_code)]
1314

1415
#[derive] //~ WARNING empty trait list in `derive`
1516
struct Foo;

src/test/run-pass/enum-size-variance.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// ignore-pretty
1212

13-
#![deny(enum_size_variance)]
13+
#![warn(variant_size_differences)]
1414
#![allow(dead_code)]
1515

1616
enum Enum1 { }
@@ -21,8 +21,8 @@ enum Enum3 { D(isize), E, F }
2121

2222
enum Enum4 { H(isize), I(isize), J }
2323

24-
enum Enum5 { //~ ERROR three times larger
25-
L(isize, isize, isize, isize), //~ NOTE this variant is the largest
24+
enum Enum5 {
25+
L(isize, isize, isize, isize), //~ WARNING three times larger
2626
M(isize),
2727
N
2828
}
@@ -33,7 +33,7 @@ enum Enum6<T, U> {
3333
Q(isize)
3434
}
3535

36-
#[allow(enum_size_variance)]
36+
#[allow(variant_size_differences)]
3737
enum Enum7 {
3838
R(isize, isize, isize, isize),
3939
S(isize),

src/test/run-pass/issue-19100.rs

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![allow(non_snake_case)]
12+
#![allow(dead_code)]
13+
#![allow(unused_variables)]
14+
1115
#[derive(Copy, Clone)]
1216
enum Foo {
1317
Bar,

src/test/run-pass/issue-25757.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ const FUNC: &'static Fn(&mut Foo) -> () = &Foo::x;
2222

2323
fn main() {
2424
let mut foo = Foo { a: 137 };
25-
FUNC(&mut foo); //~ ERROR bad
25+
FUNC(&mut foo);
2626
assert_eq!(foo.a, 5);
2727
}

src/test/run-pass/issue-2611-3.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ struct E {
2222

2323
impl A for E {
2424
fn b<F,G>(&self, _x: F) -> F { panic!() }
25-
//~^ ERROR in method `b`, type parameter 0 has 1 bound, but
2625
}
2726

2827
pub fn main() {}

src/test/run-pass/issue-27320.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![allow(unused_variables)]
12+
#![allow(dead_code)]
13+
1114
macro_rules! piece(
1215
($piece:pat) => ($piece);
1316
);

src/test/run-pass/liveness-assign-imm-local-after-ret.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
// pretty-expanded FIXME #23616
1212

13-
#![allow(unreachable_code)]
13+
#![allow(dead_code)]
1414

1515
fn test() {
1616
let _v: isize;
1717
_v = 1;
1818
return;
19-
_v = 2; //~ WARNING: unreachable statement
19+
_v = 2;
2020
}
2121

2222
pub fn main() {

src/test/run-pass/unreachable-code-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// except according to those terms.
1010

1111

12-
#![allow(unreachable_code)]
1312
#![allow(unused_variables)]
13+
#![allow(dead_code)]
1414

1515
fn id(x: bool) -> bool { x }
1616

1717
fn call_id() {
1818
let c = panic!();
19-
id(c); //~ WARNING unreachable statement
19+
id(c);
2020
}
2121

2222
fn call_id_3() { id(return) && id(return); }

src/tools/compiletest/src/runtest.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ impl<'test> TestCx<'test> {
197197
self.fatal_proc_rec("compilation failed!", &proc_res);
198198
}
199199

200+
let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
201+
if !expected_errors.is_empty() {
202+
self.check_expected_errors(expected_errors, &proc_res);
203+
}
204+
200205
let proc_res = self.exec_compiled_test();
201206

202207
if !proc_res.status.success() {
@@ -992,7 +997,8 @@ actual:\n\
992997
fn check_expected_errors(&self,
993998
expected_errors: Vec<errors::Error>,
994999
proc_res: &ProcRes) {
995-
if proc_res.status.success() {
1000+
if proc_res.status.success() &&
1001+
expected_errors.iter().any(|x| x.kind == Some(ErrorKind::Error)) {
9961002
self.fatal_proc_rec("process did not return an error status", proc_res);
9971003
}
9981004

@@ -1320,6 +1326,7 @@ actual:\n\
13201326
match self.config.mode {
13211327
CompileFail |
13221328
ParseFail |
1329+
RunPass |
13231330
Incremental => {
13241331
// If we are extracting and matching errors in the new
13251332
// fashion, then you want JSON mode. Old-skool error
@@ -1350,7 +1357,6 @@ actual:\n\
13501357
args.push(dir_opt);
13511358
}
13521359
RunFail |
1353-
RunPass |
13541360
RunPassValgrind |
13551361
Pretty |
13561362
DebugInfoGdb |

0 commit comments

Comments
 (0)