Skip to content

Commit 450cacc

Browse files
committed
Auto merge of #3743 - phansch:you_shall_not_pass, r=flip1995
Move run-pass tests to UI tests This should give us more UI coverage for free. It also removes the `run-pass` suite, so we now only have the `ui` suite.
2 parents 4259377 + a586f52 commit 450cacc

34 files changed

+60
-25
lines changed

tests/compile-test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ fn prepare_env() {
133133
#[test]
134134
fn compile_test() {
135135
prepare_env();
136-
run_mode("run-pass", "tests/run-pass".into());
137136
run_mode("ui", "tests/ui".into());
138137
run_ui_toml();
139138
}

tests/run-pass/ice-2727.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/run-pass/ice-700.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/run-pass/associated-constant-ice.rs renamed to tests/ui/crashes/associated-constant-ice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// Test for https://github.com/rust-lang/rust-clippy/issues/1698
2+
13
pub trait Trait {
24
const CONSTANT: u8;
35
}

tests/run-pass/cc_seme.rs renamed to tests/ui/crashes/cc_seme.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#[allow(dead_code)]
2+
3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/478
4+
25
enum Baz {
36
One,
47
Two,

tests/run-pass/ice-1588.rs renamed to tests/ui/crashes/ice-1588.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![allow(clippy::all)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/1588
4+
35
fn main() {
46
match 1 {
57
1 => {},
File renamed without changes.

tests/run-pass/ice-1969.rs renamed to tests/ui/crashes/ice-1969.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![allow(clippy::all)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/1969
4+
35
fn main() {}
46

57
pub trait Convert {
File renamed without changes.
File renamed without changes.

tests/ui/crashes/ice-2727.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2727
2+
3+
pub fn f(new: fn()) {
4+
new();
5+
}
6+
7+
fn main() {}

tests/run-pass/ice-2760.rs renamed to tests/ui/crashes/ice-2760.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
dead_code
66
)]
77

8-
// This should not compile-fail with:
9-
//
10-
// error[E0277]: the trait bound `T: Foo` is not satisfied
11-
//
12-
// See https://github.com/rust-lang/rust-clippy/issues/2760
8+
/// This should not compile-fail with:
9+
///
10+
/// error[E0277]: the trait bound `T: Foo` is not satisfied
11+
///
12+
/// See https://github.com/rust-lang/rust-clippy/issues/2760
1313
1414
trait Foo {
1515
type Bar;

tests/run-pass/ice-2774.rs renamed to tests/ui/crashes/ice-2774.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::HashSet;
22

3-
// See https://github.com/rust-lang/rust-clippy/issues/2774
3+
/// See https://github.com/rust-lang/rust-clippy/issues/2774
44
55
#[derive(Eq, PartialEq, Debug, Hash)]
66
pub struct Bar {

tests/run-pass/ice-2865.rs renamed to tests/ui/crashes/ice-2865.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#[allow(dead_code)]
2+
3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2865
4+
25
struct Ice {
36
size: String,
47
}

tests/run-pass/ice-3151.rs renamed to tests/ui/crashes/ice-3151.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2865
2+
13
#[derive(Clone)]
24
pub struct HashMap<V, S> {
35
hash_builder: S,

tests/run-pass/ice-3462.rs renamed to tests/ui/crashes/ice-3462.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#![allow(clippy::blacklisted_name)]
33
#![allow(unused)]
44

5+
/// Test for https://github.com/rust-lang/rust-clippy/issues/3462
6+
57
enum Foo {
68
Bar,
79
Baz,

tests/ui/crashes/ice-700.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![deny(clippy::all)]
2+
3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/700
4+
5+
fn core() {}
6+
7+
fn main() {
8+
core();
9+
}

tests/run-pass/ice_exacte_size.rs renamed to tests/ui/crashes/ice_exacte_size.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![deny(clippy::all)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/1336
4+
35
#[allow(dead_code)]
46
struct Foo;
57

tests/run-pass/if_same_then_else.rs renamed to tests/ui/crashes/if_same_then_else.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![deny(clippy::if_same_then_else)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2426
4+
35
fn main() {}
46

57
pub fn foo(a: i32, b: i32) -> Option<&'static str> {

tests/run-pass/issue-2862.rs renamed to tests/ui/crashes/issue-2862.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2826
2+
13
pub trait FooMap {
24
fn map<B, F: Fn() -> B>(&self, f: F) -> B;
35
}

tests/run-pass/issue-825.rs renamed to tests/ui/crashes/issue-825.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![allow(warnings)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/825
4+
35
// this should compile in a reasonable amount of time
46
fn rust_type_id(name: &str) {
57
if "bool" == &name[..]

tests/run-pass/match_same_arms_const.rs renamed to tests/ui/crashes/match_same_arms_const.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![deny(clippy::match_same_arms)]
22

3+
/// Test for https://github.com/rust-lang/rust-clippy/issues/2427
4+
35
const PRICE_OF_SWEETS: u32 = 5;
46
const PRICE_OF_KINDNESS: u32 = 0;
57
const PRICE_OF_DRINKS: u32 = 5;

tests/run-pass/mut_mut_macro.rs renamed to tests/ui/crashes/mut_mut_macro.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
22
#![allow(dead_code)]
33

4-
// compiletest + extern crates doesn't work together
5-
//#[macro_use]
6-
//extern crate lazy_static;
4+
// FIXME: compiletest + extern crates doesn't work together. To make this test work, it would need
5+
// the following three lines and the lazy_static crate.
6+
//
7+
// #[macro_use]
8+
// extern crate lazy_static;
9+
// use std::collections::HashMap;
710

8-
//use std::collections::HashMap;
11+
/// ensure that we don't suggest `is_nan` and `is_null` inside constants
12+
/// FIXME: once const fn is stable, suggest these functions again in constants
913
10-
// ensure that we don't suggest `is_nan` and `is_null` inside constants
11-
// FIXME: once const fn is stable, suggest these functions again in constants
1214
const BAA: *const i32 = 0 as *const i32;
1315
static mut BAR: *const i32 = BAA;
1416
static mut FOO: *const i32 = 0 as *const i32;
File renamed without changes.

tests/run-pass/returns.rs renamed to tests/ui/crashes/returns.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// Test for https://github.com/rust-lang/rust-clippy/issues/1346
2+
13
#[deny(warnings)]
24
fn cfg_return() -> i32 {
35
#[cfg(unix)]

tests/run-pass/single-match-else.rs renamed to tests/ui/crashes/single-match-else.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![warn(clippy::single_match_else)]
22

3+
//! Test for https://github.com/rust-lang/rust-clippy/issues/1588
4+
35
fn main() {
46
let n = match (42, 43) {
57
(42, n) => n,

0 commit comments

Comments
 (0)