Adapt run-pass tests to the tool_lints

This commit is contained in:
flip1995 2018-07-30 11:33:44 +02:00 committed by Manish Goregaokar
parent e9af09c274
commit ea43fedf9e
17 changed files with 43 additions and 27 deletions

View File

@ -1,6 +1,3 @@
pub trait Trait {
const CONSTANT: u8;
}

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![deny(clippy)]
#![deny(clippy::all)]
#![allow(unused_imports)]
use std::*;

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![allow(clippy)]
#![allow(clippy::all)]
fn main() {
match 1 {

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![allow(clippy)]
#![allow(clippy::all)]
fn main() { }

View File

@ -1,4 +1,6 @@
#![allow(dead_code, char_lit_as_u8, needless_bool)]
#![feature(tool_lints)]
#![allow(dead_code, clippy::char_lit_as_u8, clippy::needless_bool)]
/// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
///

View File

@ -1,4 +1,7 @@
#![allow(unused_variables, blacklisted_name, needless_pass_by_value, dead_code)]
#![feature(tool_lints)]
#![allow(unused_variables, clippy::blacklisted_name,
clippy::needless_pass_by_value, dead_code)]
// This should not compile-fail with:
//

View File

@ -1,3 +1,5 @@
#![feature(tool_lints)]
use std::collections::HashSet;
// See https://github.com/rust-lang-nursery/rust-clippy/issues/2774
@ -10,7 +12,7 @@ pub struct Bar {
#[derive(Eq, PartialEq, Debug, Hash)]
pub struct Foo {}
#[allow(implicit_hasher)]
#[allow(clippy::implicit_hasher)]
// This should not cause a 'cannot relate bound region' ICE
pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
let mut foos = HashSet::new();
@ -19,7 +21,7 @@ pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
);
}
#[allow(implicit_hasher)]
#[allow(clippy::implicit_hasher)]
// Also this should not cause a 'cannot relate bound region' ICE
pub fn add_barfoos_to_foos2(bars: &HashSet<&Bar>) {
let mut foos = HashSet::new();

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![deny(clippy)]
#![deny(clippy::all)]
fn core() {}

View File

@ -1,4 +1,6 @@
#![deny(clippy)]
#![feature(tool_lints)]
#![deny(clippy::all)]
#[allow(dead_code)]
struct Foo;

View File

@ -1,4 +1,6 @@
#![deny(if_same_then_else)]
#![feature(tool_lints)]
#![deny(clippy::if_same_then_else)]
fn main() {}

View File

@ -1,4 +1,6 @@
#![deny(match_same_arms)]
#![feature(tool_lints)]
#![deny(clippy::match_same_arms)]
const PRICE_OF_SWEETS: u32 = 5;
const PRICE_OF_KINDNESS: u32 = 0;

View File

@ -1,4 +1,6 @@
#![deny(mut_mut, zero_ptr, cmp_nan)]
#![feature(tool_lints)]
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
#![allow(dead_code)]
// compiletest + extern crates doesn't work together

View File

@ -1,4 +1,6 @@
#[deny(clippy)]
#![feature(tool_lints)]
#[deny(clippy::all)]
#[derive(Debug)]
pub enum Error {

View File

@ -1,5 +1,6 @@
#![feature(tool_lints)]
#![deny(needless_lifetimes)]
#![deny(clippy::needless_lifetimes)]
#![allow(dead_code)]
trait Foo {}

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![allow(blacklisted_name)]
#![allow(clippy::blacklisted_name)]
pub fn foo(bar: *const u8) {
println!("{:#p}", bar);

View File

@ -1,6 +1,6 @@
#![feature(tool_lints)]
#![warn(single_match_else)]
#![warn(clippy::single_match_else)]
fn main() {
let n = match (42, 43) {

View File

@ -1,12 +1,13 @@
#![feature(tool_lints)]
#![allow(clippy::useless_attribute)] //issue #2910
#[macro_use]
extern crate serde_derive;
/// Test that we do not lint for unused underscores in a `MacroAttribute`
/// expansion
#[deny(used_underscore_binding)]
#[deny(clippy::used_underscore_binding)]
#[derive(Deserialize)]
struct MacroAttributesTest {
_foo: u32,