From 3a11cd428902feafdc70c279d2dbc950f580db3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 17 Nov 2018 13:47:27 +0100 Subject: [PATCH] remove unused allow() attributes, NFC --- clippy_lints/src/consts.rs | 2 +- clippy_lints/src/drop_forget_ref.rs | 1 - clippy_lints/src/enum_variants.rs | 2 -- clippy_lints/src/eta_reduction.rs | 1 - clippy_lints/src/lib.rs | 4 ++-- clippy_lints/src/minmax.rs | 1 - clippy_lints/src/panic_unimplemented.rs | 1 - clippy_lints/src/redundant_pattern_matching.rs | 1 - clippy_lints/src/types.rs | 4 ---- clippy_lints/src/utils/author.rs | 2 -- clippy_lints/src/utils/inspector.rs | 2 -- src/driver.rs | 1 - src/main.rs | 2 -- 13 files changed, 3 insertions(+), 21 deletions(-) diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index 5d509ef76f3f..67c0de934969 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -293,7 +293,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { instance, promoted: None, }; - + let result = self.tcx.const_eval(self.param_env.and(gid)).ok()?; let ret = miri_to_const(self.tcx, result); if ret.is_some() { diff --git a/clippy_lints/src/drop_forget_ref.rs b/clippy_lints/src/drop_forget_ref.rs index cac5d0da71d5..9bead9c1d869 100644 --- a/clippy_lints/src/drop_forget_ref.rs +++ b/clippy_lints/src/drop_forget_ref.rs @@ -116,7 +116,6 @@ const DROP_COPY_SUMMARY: &str = "calls to `std::mem::drop` with a value that imp const FORGET_COPY_SUMMARY: &str = "calls to `std::mem::forget` with a value that implements Copy. \ Forgetting a copy leaves the original intact."; -#[allow(missing_copy_implementations)] pub struct Pass; impl LintPass for Pass { diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index 16d1e40484d0..121a33f9475f 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -156,8 +156,6 @@ fn partial_rmatch(post: &str, name: &str) -> usize { .count() } -// FIXME: #600 -#[allow(clippy::while_let_on_iterator)] fn check_variant( cx: &EarlyContext<'_>, threshold: u64, diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index 59c7f8a36dba..95191b471a87 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -15,7 +15,6 @@ use crate::rustc::hir::*; use crate::utils::{is_adjusted, iter_input_pats, snippet_opt, span_lint_and_then}; use crate::rustc_errors::Applicability; -#[allow(missing_copy_implementations)] pub struct EtaPass; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 6ebe9df6a1ef..3debe567cda1 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -15,7 +15,7 @@ #![feature(slice_patterns)] #![feature(stmt_expr_attributes)] #![feature(range_contains)] -#![allow(clippy::shadow_reuse, clippy::missing_docs_in_private_items)] +#![allow(clippy::missing_docs_in_private_items)] #![recursion_limit = "256"] #![feature(macro_at_most_once_rep)] @@ -1005,7 +1005,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) { // only exists to let the dogfood integration test works. // Don't run clippy as an executable directly -#[allow(dead_code, clippy::print_stdout)] +#[allow(dead_code)] fn main() { panic!("Please use the cargo-clippy executable"); } diff --git a/clippy_lints/src/minmax.rs b/clippy_lints/src/minmax.rs index 222247307c8a..4a3fcfc853e7 100644 --- a/clippy_lints/src/minmax.rs +++ b/clippy_lints/src/minmax.rs @@ -35,7 +35,6 @@ declare_clippy_lint! { "`min(_, max(_, _))` (or vice versa) with bounds clamping the result to a constant" } -#[allow(missing_copy_implementations)] pub struct MinMaxPass; impl LintPass for MinMaxPass { diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index 003c9bdf084b..68b989721af1 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -52,7 +52,6 @@ declare_clippy_lint! { "`unimplemented!` should not be present in production code" } -#[allow(missing_copy_implementations)] pub struct Pass; impl LintPass for Pass { diff --git a/clippy_lints/src/redundant_pattern_matching.rs b/clippy_lints/src/redundant_pattern_matching.rs index 7c888b36503a..130b11443294 100644 --- a/clippy_lints/src/redundant_pattern_matching.rs +++ b/clippy_lints/src/redundant_pattern_matching.rs @@ -63,7 +63,6 @@ impl LintPass for Pass { } impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { - #[allow(clippy::similar_names)] fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { if let ExprKind::Match(ref op, ref arms, ref match_source) = expr.node { match match_source { diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 035ca2b04964..c9068be838ff 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -34,7 +34,6 @@ use crate::utils::paths; use crate::consts::{constant, Constant}; /// Handles all the linting of funky types -#[allow(missing_copy_implementations)] pub struct TypePass; /// **What it does:** Checks for use of `Box>` anywhere in the code. @@ -371,7 +370,6 @@ fn is_any_trait(t: &hir::Ty) -> bool { false } -#[allow(missing_copy_implementations)] pub struct LetPass; /// **What it does:** Checks for binding a unit value. @@ -447,7 +445,6 @@ declare_clippy_lint! { "comparing unit values" } -#[allow(missing_copy_implementations)] pub struct UnitCmp; impl LintPass for UnitCmp { @@ -1142,7 +1139,6 @@ declare_clippy_lint! { "usage of very complex types that might be better factored into `type` definitions" } -#[allow(missing_copy_implementations)] pub struct TypeComplexityPass { threshold: u64, } diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 6650dd67b4f4..d88a70e4e496 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -11,8 +11,6 @@ //! A group of attributes that can be attached to Rust code in order //! to generate a clippy lint detecting said code automatically. -#![allow(clippy::print_stdout, clippy::use_debug)] - use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use crate::rustc::{declare_tool_lint, lint_array}; use crate::rustc::hir; diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 54ca0736c52e..e750c1c9bce3 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -8,8 +8,6 @@ // except according to those terms. -#![allow(clippy::print_stdout, clippy::use_debug)] - //! checks for attributes use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; diff --git a/src/driver.rs b/src/driver.rs index 9abe6bd91de5..f99c37b85198 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -27,7 +27,6 @@ use std::convert::TryInto; use std::path::Path; use std::process::{exit, Command}; -#[allow(clippy::print_stdout)] fn show_version() { println!(env!("CARGO_PKG_VERSION")); } diff --git a/src/main.rs b/src/main.rs index 4a1dc487cea0..be28fe12899c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,12 +41,10 @@ it to allow or deny lints from the code, eg.: #[cfg_attr(feature = "cargo-clippy", allow(needless_lifetimes))] "#; -#[allow(clippy::print_stdout)] fn show_help() { println!("{}", CARGO_CLIPPY_HELP); } -#[allow(clippy::print_stdout)] fn show_version() { let version_info = rustc_tools_util::get_version_info!(); println!("{}", version_info);