mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Auto merge of #35674 - ahmedcharles:rpass, r=alexcrichton
Fix compiletest so it respects warnings for run-pass.
This commit is contained in:
commit
a23064af5e
@ -9,6 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(rustc_private)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
extern crate serialize;
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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)]
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -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;
|
||||
|
@ -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<T, U> {
|
||||
Q(isize)
|
||||
}
|
||||
|
||||
#[allow(enum_size_variance)]
|
||||
#[allow(variant_size_differences)]
|
||||
enum Enum7 {
|
||||
R(isize, isize, isize, isize),
|
||||
S(isize),
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ struct E {
|
||||
|
||||
impl A for E {
|
||||
fn b<F,G>(&self, _x: F) -> F { panic!() }
|
||||
//~^ ERROR in method `b`, type parameter 0 has 1 bound, but
|
||||
}
|
||||
|
||||
pub fn main() {}
|
||||
|
@ -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);
|
||||
);
|
||||
|
@ -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() {
|
||||
|
@ -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); }
|
||||
|
@ -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<errors::Error>,
|
||||
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 |
|
||||
|
Loading…
Reference in New Issue
Block a user