Skip to content

Move run-pass tests to UI tests #3743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
5 changes: 0 additions & 5 deletions tests/run-pass/ice-2727.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/run-pass/ice-700.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/1698

pub trait Trait {
const CONSTANT: u8;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/run-pass/cc_seme.rs → tests/ui/crashes/cc_seme.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#[allow(dead_code)]

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

enum Baz {
One,
Two,
Expand Down
2 changes: 2 additions & 0 deletions tests/run-pass/ice-1588.rs → tests/ui/crashes/ice-1588.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![allow(clippy::all)]

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

fn main() {
match 1 {
1 => {},
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/run-pass/ice-1969.rs → tests/ui/crashes/ice-1969.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![allow(clippy::all)]

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

fn main() {}

pub trait Convert {
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/ui/crashes/ice-2727.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/2727

pub fn f(new: fn()) {
new();
}

fn main() {}
10 changes: 5 additions & 5 deletions tests/run-pass/ice-2760.rs → tests/ui/crashes/ice-2760.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions tests/run-pass/ice-2865.rs → tests/ui/crashes/ice-2865.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#[allow(dead_code)]

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

struct Ice {
size: String,
}
Expand Down
2 changes: 2 additions & 0 deletions tests/run-pass/ice-3151.rs → tests/ui/crashes/ice-3151.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 2 additions & 0 deletions tests/run-pass/ice-3462.rs → tests/ui/crashes/ice-3462.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions tests/ui/crashes/ice-700.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![deny(clippy::all)]

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

fn core() {}

fn main() {
core();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![deny(clippy::all)]

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

#[allow(dead_code)]
struct Foo;

Expand Down
Original file line number Diff line number Diff line change
@@ -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> {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/run-pass/issue-825.rs → tests/ui/crashes/issue-825.rs
Original file line number Diff line number Diff line change
@@ -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[..]
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/run-pass/returns.rs → tests/ui/crashes/returns.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// Test for https://github.com/rust-lang/rust-clippy/issues/1346

#[deny(warnings)]
fn cfg_return() -> i32 {
#[cfg(unix)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down