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.
This commit is contained in:
bors 2019-02-06 08:59:55 +00:00
commit 450cacc5f4
34 changed files with 60 additions and 25 deletions

View File

@ -133,7 +133,6 @@ fn prepare_env() {
#[test]
fn compile_test() {
prepare_env();
run_mode("run-pass", "tests/run-pass".into());
run_mode("ui", "tests/ui".into());
run_ui_toml();
}

View File

@ -1,5 +0,0 @@
pub fn f(new: fn()) {
new();
}
fn main() {}

View File

@ -1,7 +0,0 @@
#![deny(clippy::all)]
fn core() {}
fn main() {
core();
}

View File

@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/1698
pub trait Trait {
const CONSTANT: u8;
}

View File

@ -1,4 +1,7 @@
#[allow(dead_code)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/478
enum Baz {
One,
Two,

View File

@ -1,5 +1,7 @@
#![allow(clippy::all)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/1588
fn main() {
match 1 {
1 => {},

View File

@ -1,5 +1,7 @@
#![allow(clippy::all)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/1969
fn main() {}
pub trait Convert {

View File

@ -0,0 +1,7 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/2727
pub fn f(new: fn()) {
new();
}
fn main() {}

View File

@ -5,11 +5,11 @@
dead_code
)]
// This should not compile-fail with:
//
// error[E0277]: the trait bound `T: Foo` is not satisfied
//
// See https://github.com/rust-lang/rust-clippy/issues/2760
/// This should not compile-fail with:
///
/// error[E0277]: the trait bound `T: Foo` is not satisfied
///
/// See https://github.com/rust-lang/rust-clippy/issues/2760
trait Foo {
type Bar;

View File

@ -1,6 +1,6 @@
use std::collections::HashSet;
// See https://github.com/rust-lang/rust-clippy/issues/2774
/// See https://github.com/rust-lang/rust-clippy/issues/2774
#[derive(Eq, PartialEq, Debug, Hash)]
pub struct Bar {

View File

@ -1,4 +1,7 @@
#[allow(dead_code)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/2865
struct Ice {
size: String,
}

View File

@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/2865
#[derive(Clone)]
pub struct HashMap<V, S> {
hash_builder: S,

View File

@ -2,6 +2,8 @@
#![allow(clippy::blacklisted_name)]
#![allow(unused)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/3462
enum Foo {
Bar,
Baz,

View File

@ -0,0 +1,9 @@
#![deny(clippy::all)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/700
fn core() {}
fn main() {
core();
}

View File

@ -1,5 +1,7 @@
#![deny(clippy::all)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/1336
#[allow(dead_code)]
struct Foo;

View File

@ -1,5 +1,7 @@
#![deny(clippy::if_same_then_else)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/2426
fn main() {}
pub fn foo(a: i32, b: i32) -> Option<&'static str> {

View File

@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/2826
pub trait FooMap {
fn map<B, F: Fn() -> B>(&self, f: F) -> B;
}

View File

@ -1,5 +1,7 @@
#![allow(warnings)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/825
// this should compile in a reasonable amount of time
fn rust_type_id(name: &str) {
if "bool" == &name[..]

View File

@ -1,5 +1,7 @@
#![deny(clippy::match_same_arms)]
/// Test for https://github.com/rust-lang/rust-clippy/issues/2427
const PRICE_OF_SWEETS: u32 = 5;
const PRICE_OF_KINDNESS: u32 = 0;
const PRICE_OF_DRINKS: u32 = 5;

View File

@ -1,14 +1,16 @@
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
#![allow(dead_code)]
// compiletest + extern crates doesn't work together
//#[macro_use]
//extern crate lazy_static;
// FIXME: compiletest + extern crates doesn't work together. To make this test work, it would need
// the following three lines and the lazy_static crate.
//
// #[macro_use]
// extern crate lazy_static;
// use std::collections::HashMap;
//use std::collections::HashMap;
/// ensure that we don't suggest `is_nan` and `is_null` inside constants
/// FIXME: once const fn is stable, suggest these functions again in constants
// ensure that we don't suggest `is_nan` and `is_null` inside constants
// FIXME: once const fn is stable, suggest these functions again in constants
const BAA: *const i32 = 0 as *const i32;
static mut BAR: *const i32 = BAA;
static mut FOO: *const i32 = 0 as *const i32;

View File

@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/1346
#[deny(warnings)]
fn cfg_return() -> i32 {
#[cfg(unix)]

View File

@ -1,5 +1,7 @@
#![warn(clippy::single_match_else)]
//! Test for https://github.com/rust-lang/rust-clippy/issues/1588
fn main() {
let n = match (42, 43) {
(42, n) => n,