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

+1-1
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

+1
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

+1
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

-2
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

+1
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

-2
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

-2
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

-2
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

-2
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

-2
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

tests/ui/crashes/ice-2499.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(dead_code, clippy::char_lit_as_u8, clippy::needless_bool)]
42

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

tests/ui/crashes/ice-2594.rs

-2
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 `SpanlessHash` / `consts::constant`

tests/ui/crashes/ice-2727.rs

-2
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/2727
42
53
pub fn f(new: fn()) {

tests/ui/crashes/ice-2760.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(
42
unused_variables,
53
clippy::blacklisted_name,

tests/ui/crashes/ice-2774.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
use std::collections::HashSet;
42

53
// See rust-lang/rust-clippy#2774.

tests/ui/crashes/ice-2862.rs

-2
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/2862
42
53
pub trait FooMap {

tests/ui/crashes/ice-2865.rs

-2
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/2865

tests/ui/crashes/ice-3151.rs

-2
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/2865
42
53
#[derive(Clone)]

tests/ui/crashes/ice-3462.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![warn(clippy::all)]
42
#![allow(clippy::blacklisted_name)]
53
#![allow(unused)]

tests/ui/crashes/ice-3741.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// aux-build:proc_macro_crash.rs
2-
// run-pass
32

43
#![warn(clippy::suspicious_else_formatting)]
54

tests/ui/crashes/ice-3747.rs

-2
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/3747
42
53
macro_rules! a {

tests/ui/crashes/ice-4727.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![warn(clippy::use_self)]
42

53
#[path = "auxiliary/ice-4727-aux.rs"]

tests/ui/crashes/ice-4760.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// run-pass
21
const COUNT: usize = 2;
32
struct Thing;
43
trait Dummy {}

tests/ui/crashes/ice-700.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::all)]
42

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

tests/ui/crashes/ice_exacte_size.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::all)]
42

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

tests/ui/crashes/if_same_then_else.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(clippy::comparison_chain)]
42
#![deny(clippy::if_same_then_else)]
53

tests/ui/crashes/issue-825.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(warnings)]
42

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

tests/ui/crashes/issues_loop_mut_cond.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(dead_code)]
42

53
/// Issue: https://github.com/rust-lang/rust-clippy/issues/2596

tests/ui/crashes/match_same_arms_const.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::match_same_arms)]
42

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

tests/ui/crashes/mut_mut_macro.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
42
#![allow(dead_code)]
53

tests/ui/crashes/needless_borrow_fp.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#[deny(clippy::all)]
42
#[derive(Debug)]
53
pub enum Error {

tests/ui/crashes/needless_lifetimes_impl_trait.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![deny(clippy::needless_lifetimes)]
42
#![allow(dead_code)]
53

tests/ui/crashes/procedural_macro.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#[macro_use]
42
extern crate clippy_mini_macro_test;
53

tests/ui/crashes/regressions.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(clippy::blacklisted_name)]
42

53
pub fn foo(bar: *const u8) {

tests/ui/crashes/returns.rs

-2
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/1346
42
53
#[deny(warnings)]

tests/ui/crashes/single-match-else.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![warn(clippy::single_match_else)]
42

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

tests/ui/crashes/trivial_bounds.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![feature(trivial_bounds)]
42
#![allow(unused, trivial_bounds)]
53

tests/ui/crashes/used_underscore_binding_macro.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// run-pass
2-
31
#![allow(clippy::useless_attribute)] //issue #2910
42

53
#[macro_use]

0 commit comments

Comments
 (0)