From ea43fedf9e111e904205ba5ebaa9ef8d9ff8f96c Mon Sep 17 00:00:00 2001 From: flip1995 <9744647+flip1995@users.noreply.github.com> Date: Mon, 30 Jul 2018 11:33:44 +0200 Subject: [PATCH] Adapt run-pass tests to the tool_lints --- tests/run-pass/associated-constant-ice.rs | 3 --- tests/run-pass/enum-glob-import-crate.rs | 4 ++-- tests/run-pass/ice-1588.rs | 4 ++-- tests/run-pass/ice-1969.rs | 4 ++-- tests/run-pass/ice-2499.rs | 4 +++- tests/run-pass/ice-2760.rs | 5 ++++- tests/run-pass/ice-2774.rs | 6 ++++-- tests/run-pass/ice-700.rs | 4 ++-- tests/run-pass/ice_exacte_size.rs | 4 +++- tests/run-pass/if_same_then_else.rs | 4 +++- tests/run-pass/match_same_arms_const.rs | 4 +++- tests/run-pass/mut_mut_macro.rs | 4 +++- tests/run-pass/needless_borrow_fp.rs | 4 +++- tests/run-pass/needless_lifetimes_impl_trait.rs | 3 ++- tests/run-pass/regressions.rs | 4 ++-- tests/run-pass/single-match-else.rs | 4 ++-- tests/run-pass/used_underscore_binding_macro.rs | 5 +++-- 17 files changed, 43 insertions(+), 27 deletions(-) diff --git a/tests/run-pass/associated-constant-ice.rs b/tests/run-pass/associated-constant-ice.rs index 744de9bcf38..2c5c90683cc 100644 --- a/tests/run-pass/associated-constant-ice.rs +++ b/tests/run-pass/associated-constant-ice.rs @@ -1,6 +1,3 @@ - - - pub trait Trait { const CONSTANT: u8; } diff --git a/tests/run-pass/enum-glob-import-crate.rs b/tests/run-pass/enum-glob-import-crate.rs index 21ed2dbf991..6014558a184 100644 --- a/tests/run-pass/enum-glob-import-crate.rs +++ b/tests/run-pass/enum-glob-import-crate.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![deny(clippy)] +#![deny(clippy::all)] #![allow(unused_imports)] use std::*; diff --git a/tests/run-pass/ice-1588.rs b/tests/run-pass/ice-1588.rs index 780df523511..fcda3814e4a 100644 --- a/tests/run-pass/ice-1588.rs +++ b/tests/run-pass/ice-1588.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![allow(clippy)] +#![allow(clippy::all)] fn main() { match 1 { diff --git a/tests/run-pass/ice-1969.rs b/tests/run-pass/ice-1969.rs index 29633982848..43d6bd8bfbc 100644 --- a/tests/run-pass/ice-1969.rs +++ b/tests/run-pass/ice-1969.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![allow(clippy)] +#![allow(clippy::all)] fn main() { } diff --git a/tests/run-pass/ice-2499.rs b/tests/run-pass/ice-2499.rs index 01deb7abfc1..c6793a78529 100644 --- a/tests/run-pass/ice-2499.rs +++ b/tests/run-pass/ice-2499.rs @@ -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` /// diff --git a/tests/run-pass/ice-2760.rs b/tests/run-pass/ice-2760.rs index 01ca6d42a94..2e9c6d527c4 100644 --- a/tests/run-pass/ice-2760.rs +++ b/tests/run-pass/ice-2760.rs @@ -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: // diff --git a/tests/run-pass/ice-2774.rs b/tests/run-pass/ice-2774.rs index c6d9bb4a276..6b14a2b5e03 100644 --- a/tests/run-pass/ice-2774.rs +++ b/tests/run-pass/ice-2774.rs @@ -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(); diff --git a/tests/run-pass/ice-700.rs b/tests/run-pass/ice-700.rs index a1e3a6756e9..3992af2c280 100644 --- a/tests/run-pass/ice-700.rs +++ b/tests/run-pass/ice-700.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![deny(clippy)] +#![deny(clippy::all)] fn core() {} diff --git a/tests/run-pass/ice_exacte_size.rs b/tests/run-pass/ice_exacte_size.rs index 914153c64ff..3d25aa50499 100644 --- a/tests/run-pass/ice_exacte_size.rs +++ b/tests/run-pass/ice_exacte_size.rs @@ -1,4 +1,6 @@ -#![deny(clippy)] +#![feature(tool_lints)] + +#![deny(clippy::all)] #[allow(dead_code)] struct Foo; diff --git a/tests/run-pass/if_same_then_else.rs b/tests/run-pass/if_same_then_else.rs index eb14ce80756..b7536e25028 100644 --- a/tests/run-pass/if_same_then_else.rs +++ b/tests/run-pass/if_same_then_else.rs @@ -1,4 +1,6 @@ -#![deny(if_same_then_else)] +#![feature(tool_lints)] + +#![deny(clippy::if_same_then_else)] fn main() {} diff --git a/tests/run-pass/match_same_arms_const.rs b/tests/run-pass/match_same_arms_const.rs index 08acc2bc4d8..59b939f3e01 100644 --- a/tests/run-pass/match_same_arms_const.rs +++ b/tests/run-pass/match_same_arms_const.rs @@ -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; diff --git a/tests/run-pass/mut_mut_macro.rs b/tests/run-pass/mut_mut_macro.rs index 2b916c025d3..bfb9cfc7170 100644 --- a/tests/run-pass/mut_mut_macro.rs +++ b/tests/run-pass/mut_mut_macro.rs @@ -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 diff --git a/tests/run-pass/needless_borrow_fp.rs b/tests/run-pass/needless_borrow_fp.rs index 9dc508006ed..204968e48d0 100644 --- a/tests/run-pass/needless_borrow_fp.rs +++ b/tests/run-pass/needless_borrow_fp.rs @@ -1,4 +1,6 @@ -#[deny(clippy)] +#![feature(tool_lints)] + +#[deny(clippy::all)] #[derive(Debug)] pub enum Error { diff --git a/tests/run-pass/needless_lifetimes_impl_trait.rs b/tests/run-pass/needless_lifetimes_impl_trait.rs index 700215baa64..f727b2547e3 100644 --- a/tests/run-pass/needless_lifetimes_impl_trait.rs +++ b/tests/run-pass/needless_lifetimes_impl_trait.rs @@ -1,5 +1,6 @@ +#![feature(tool_lints)] -#![deny(needless_lifetimes)] +#![deny(clippy::needless_lifetimes)] #![allow(dead_code)] trait Foo {} diff --git a/tests/run-pass/regressions.rs b/tests/run-pass/regressions.rs index d5e343c56c2..aa4e16d3949 100644 --- a/tests/run-pass/regressions.rs +++ b/tests/run-pass/regressions.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![allow(blacklisted_name)] +#![allow(clippy::blacklisted_name)] pub fn foo(bar: *const u8) { println!("{:#p}", bar); diff --git a/tests/run-pass/single-match-else.rs b/tests/run-pass/single-match-else.rs index b8fa7294dcd..379a98fc3ec 100644 --- a/tests/run-pass/single-match-else.rs +++ b/tests/run-pass/single-match-else.rs @@ -1,6 +1,6 @@ +#![feature(tool_lints)] - -#![warn(single_match_else)] +#![warn(clippy::single_match_else)] fn main() { let n = match (42, 43) { diff --git a/tests/run-pass/used_underscore_binding_macro.rs b/tests/run-pass/used_underscore_binding_macro.rs index c9c77257c0e..73f48a96e77 100644 --- a/tests/run-pass/used_underscore_binding_macro.rs +++ b/tests/run-pass/used_underscore_binding_macro.rs @@ -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,