Skip to content

Commit 6e5306d

Browse files
committed
Auto merge of #6084 - ebroto:ui_tests_cleanup, r=flip1995
UI tests cleanup `@matthiaskrgr` noticed some `run-pass` annotations in some crash tests that were added in #3922. At that moment they seemed to be necessary to make the tests fail in case of an ICE, but they do not seem to be needed anymore. To test this I forced an ICE in a file with and without annotations, with and without stderr files, and the ICE makes the test fail every time. In addition, I've applied a suggestion from `@ehuss` and `@jyn514` to add `emit=metadata` to the rustc flags for the UI tests. In my machine this improved the run time from ~17 to ~12 seconds. changelog: none
2 parents cc1998f + 1cb3c00 commit 6e5306d

38 files changed

+4
-67
lines changed

tests/compile-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn default_config() -> compiletest::Config {
7171
}
7272

7373
config.target_rustcflags = Some(format!(
74-
"-L {0} -L {1} -Dwarnings -Zui-testing {2}",
74+
"--emit=metadata -L {0} -L {1} -Dwarnings -Zui-testing {2}",
7575
host_lib().join("deps").display(),
7676
cargo::TARGET_LIB.join("deps").display(),
7777
third_party_crates(),

tests/ui/auxiliary/proc_macro_attr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: --emit=link
12
// no-prefer-dynamic
23

34
#![crate_type = "proc-macro"]

tests/ui/auxiliary/proc_macro_derive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: --emit=link
12
// no-prefer-dynamic
23

34
#![crate_type = "proc-macro"]

tests/ui/crashes/associated-constant-ice.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
/// Test for https://github.com/rust-lang/rust-clippy/issues/1698
42
53
pub trait Trait {

tests/ui/crashes/auxiliary/proc_macro_crash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: --emit=link
12
// no-prefer-dynamic
23
// ^ compiletest by default builds all aux files as dylibs, but we don't want that for proc-macro
34
// crates. If we don't set this, compiletest will override the `crate_type` attribute below and

tests/ui/crashes/cc_seme.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#[allow(dead_code)]
42

53
/// Test for https://github.com/rust-lang/rust-clippy/issues/478

tests/ui/crashes/enum-glob-import-crate.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::all)]
42
#![allow(unused_imports)]
53

tests/ui/crashes/ice-1588.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(clippy::all)]
42

53
/// Test for https://github.com/rust-lang/rust-clippy/issues/1588

tests/ui/crashes/ice-1782.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(dead_code, unused_variables)]
42

53
/// Should not trigger an ICE in `SpanlessEq` / `consts::constant`

tests/ui/crashes/ice-1969.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(clippy::all)]
42

53
/// Test for https://github.com/rust-lang/rust-clippy/issues/1969

0 commit comments

Comments
 (0)