This commit is contained in:
Yuki Okushi 2020-01-11 20:37:08 +09:00
parent 10cf141ebb
commit 39947992b5
153 changed files with 303 additions and 456 deletions

View File

@ -1,8 +1,7 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol;
use std::f64::consts as f64;
use syntax::ast::{FloatTy, LitFloatType, LitKind};

View File

@ -1,9 +1,8 @@
use crate::consts::constant_simple;
use crate::utils::span_lint;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -1,6 +1,5 @@
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View File

@ -2,10 +2,9 @@
use crate::utils::paths;
use crate::utils::{is_direct_expn_of, is_expn_of, match_function_call, snippet_opt, span_help_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::LitKind;
declare_clippy_lint! {

View File

@ -3,13 +3,12 @@
};
use crate::utils::{higher, sugg};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for `a = a op b` or `a = b commutative_op a`

View File

@ -1,11 +1,10 @@
use crate::utils::{match_def_path, span_help_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::def_id::DefId;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for usage of invalid atomic

View File

@ -6,15 +6,13 @@
span_lint_and_then, without_block_comments,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{
in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray,
LintContext, LintPass,
in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext,
};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use semver::Version;

View File

@ -2,11 +2,10 @@
use crate::utils::sugg::Sugg;
use crate::utils::{span_lint, span_lint_and_then};
use if_chain::if_chain;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use syntax::ast::LitKind;

View File

@ -1,9 +1,8 @@
use crate::utils::span_lint;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_clippy_lint! {
/// **What it does:** Checks for usage of blacklisted names for variables, such

View File

@ -1,11 +1,10 @@
use crate::utils::*;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for `if` conditions that use blocks to contain an

View File

@ -3,14 +3,13 @@
span_lint_and_then, SpanlessEq,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::intravisit;
use rustc_hir::intravisit::*;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast::LitKind;

View File

@ -3,12 +3,11 @@
span_lint_and_sugg, walk_ptrs_ty,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::{Name, UintTy};
declare_clippy_lint! {

View File

@ -3,9 +3,8 @@
use std::path::PathBuf;
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::DUMMY_SP;
use syntax::ast::*;

View File

@ -1,11 +1,10 @@
//! lint on manually implemented checked conversions that could be transformed into `try_from`
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::LitKind;
use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq};

View File

@ -1,11 +1,10 @@
//! calculate cognitive complexity and warn about overly complex functions
use rustc::hir::map::Map;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{LateContext, LateLintPass, LintContext};
use rustc_hir::intravisit::{walk_expr, FnKind, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use rustc_span::BytePos;
use syntax::ast::Attribute;

View File

@ -13,9 +13,8 @@
//! This lint is **warn** by default
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast;
use crate::utils::sugg::Sugg;

View File

@ -1,10 +1,9 @@
use crate::utils::{
get_trait_def_id, if_sequence, implements_trait, parent_node_is_if_expr, paths, span_help_and_lint, SpanlessEq,
};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks comparison chains written with `if` that can be

View File

@ -1,11 +1,10 @@
use crate::utils::{get_parent_expr, higher, if_sequence, same_tys, snippet, span_lint_and_then, span_note_and_lint};
use crate::utils::{SpanlessEq, SpanlessHash};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::Ty;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol::Symbol;
use std::collections::hash_map::Entry;
use std::hash::BuildHasherDefault;

View File

@ -1,8 +1,7 @@
use crate::utils::{is_copy, match_path, paths, span_note_and_lint};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{Item, ItemKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for types that implement `Copy` as well as

View File

@ -1,8 +1,7 @@
use crate::utils::{snippet_opt, span_help_and_lint, span_lint_and_sugg};
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast;
use syntax::tokenstream::TokenStream;

View File

@ -1,10 +1,9 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{any_parent_is_automatically_derived, match_def_path, paths, span_lint_and_sugg};

View File

@ -1,11 +1,10 @@
use crate::utils::paths;
use crate::utils::{is_automatically_derived, is_copy, match_path, span_lint_and_then};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self, Ty};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -1,10 +1,9 @@
use crate::utils::{match_type, paths, return_ty, span_lint};
use itertools::Itertools;
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::{BytePos, MultiSpan, Span};
use rustc_span::Pos;
use std::ops::Range;

View File

@ -1,10 +1,9 @@
//! Lint on unnecessary double comparisons. Some examples:
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq};

View File

@ -1,7 +1,6 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
declare_clippy_lint! {

View File

@ -1,9 +1,8 @@
use crate::utils::{match_def_path, paths, span_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateLintPass, LintArray, LintPass};
use rustc::lint::LateLintPass;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for generics with `std::ops::Drop` as bounds.

View File

@ -1,10 +1,9 @@
use crate::utils::{is_copy, match_def_path, paths, qpath_res, span_note_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for calls to `std::mem::drop` with a reference

View File

@ -1,9 +1,8 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Spanned;
use crate::consts::{constant, Constant};

View File

@ -1,8 +1,7 @@
//! Lint on if expressions with an else if, but without a final else branch.
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View File

@ -1,10 +1,9 @@
//! lint when there is an enum with no variants
use crate::utils::span_lint_and_then;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for `enum`s with no variants.

View File

@ -2,13 +2,12 @@
use crate::utils::{get_item_name, higher, match_type, paths, snippet, snippet_opt};
use crate::utils::{snippet_with_applicability, span_lint_and_then, walk_ptrs_ty};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -3,12 +3,11 @@
use crate::consts::{miri_to_const, Constant};
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc::ty::util::IntTypeExt;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use std::convert::TryFrom;
use syntax::ast::{IntTy, UintTy};

View File

@ -1,11 +1,10 @@
//! lint on `use`ing all variants of an enum
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::def::{DefKind, Res};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -2,9 +2,8 @@
use crate::utils::{camel_case, is_present_in_source};
use crate::utils::{span_help_and_lint, span_lint};
use rustc::impl_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, Lint, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass, Lint};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use syntax::ast::*;

View File

@ -1,9 +1,8 @@
use crate::utils::{implements_trait, is_copy, multispan_sugg, snippet, span_lint, span_lint_and_then, SpanlessEq};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for equal operands to comparison, logical and

View File

@ -1,7 +1,6 @@
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use crate::consts::{constant_simple, Constant};

View File

@ -1,11 +1,10 @@
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::layout::LayoutOf;
use rustc::ty::{self, Ty};
use rustc_hir::intravisit as visit;
use rustc_hir::HirIdSet;
use rustc_hir::{self, *};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use rustc_typeck::expr_use_visitor::*;

View File

@ -1,11 +1,10 @@
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::ty::{self, Ty};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{
implements_trait, is_adjusted, iter_input_pats, snippet_opt, span_lint_and_then, type_is_unsafe_function,

View File

@ -1,12 +1,11 @@
use crate::utils::{get_parent_expr, span_lint, span_note_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for a read and a write to the same variable where

View File

@ -1,12 +1,11 @@
use crate::utils::span_lint_and_sugg;
use crate::utils::sugg::format_numeric_literal;
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol::Symbol;
use std::f32;
use std::f64;

View File

@ -1,9 +1,8 @@
use crate::utils::{is_entrypoint_fn, match_def_path, paths, qpath_res, span_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{Expr, ExprKind, Item, ItemKind, Node};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** `exit()` terminates the program and doesn't provide a

View File

@ -1,10 +1,9 @@
use crate::utils::{is_expn_of, match_function_call, paths, span_lint, span_lint_and_sugg};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::LitKind;
declare_clippy_lint! {

View File

@ -1,12 +1,11 @@
use crate::utils::paths::{BEGIN_PANIC, BEGIN_PANIC_FMT, FROM_TRAIT, OPTION, RESULT};
use crate::utils::{is_expn_of, match_def_path, method_chain_args, span_lint_and_then, walk_ptrs_ty};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self, Ty};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
declare_clippy_lint! {

View File

@ -4,11 +4,10 @@
walk_ptrs_ty,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{LateContext, LateLintPass, LintContext};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast::LitKind;

View File

@ -1,8 +1,7 @@
use crate::utils::{differing_macro_contexts, snippet_opt, span_help_and_lint, span_note_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
declare_clippy_lint! {

View File

@ -5,15 +5,14 @@
};
use matches::matches;
use rustc::hir::map::Map;
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::ty::{self, Ty};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_hir::{def::Res, def_id::DefId};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use rustc_target::spec::abi::Abi;
use syntax::ast::Attribute;

View File

@ -2,11 +2,10 @@
use crate::utils::{is_type_diagnostic_item, snippet_with_applicability, span_lint_and_sugg, SpanlessEq};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Symbol;
use syntax::ast::LitKind;

View File

@ -1,11 +1,10 @@
use crate::utils::{
match_def_path, match_trait_method, paths, same_tys, snippet, snippet_with_macro_callsite, span_lint_and_then,
};
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_clippy_lint! {
/// **What it does:** Checks for always-identical `Into`/`From`/`IntoIter` conversions.

View File

@ -1,8 +1,7 @@
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use crate::consts::{constant_simple, Constant};

View File

@ -1,9 +1,8 @@
//! lint on if branches that could be swapped so no `!` operation is necessary
//! on the condition
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View File

@ -4,14 +4,11 @@
snippet_opt, span_lint_and_then,
};
use if_chain::if_chain;
use rustc::{
declare_lint_pass,
lint::{LateContext, LateLintPass, LintArray, LintPass},
};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::intravisit::FnKind;
use rustc_hir::{Body, Expr, ExprKind, FnDecl, HirId, MatchSource, StmtKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -4,11 +4,10 @@
use crate::utils;
use crate::utils::higher;
use crate::utils::higher::Range;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::RangeLimits;
declare_clippy_lint! {

View File

@ -1,10 +1,9 @@
use super::utils::{get_arg_name, match_var, remove_blocks, snippet_with_applicability, span_lint_and_sugg};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for matches being used to destructure a single-variant enum

View File

@ -1,7 +1,6 @@
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{get_trait_def_id, higher, implements_trait, match_qpath, match_type, paths, span_lint};

View File

@ -1,11 +1,10 @@
//! lint on inherent implementations
use crate::utils::{in_macro, span_lint_and_then};
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::Span;
declare_clippy_lint! {

View File

@ -1,8 +1,7 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{ImplItem, ImplItemKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{
get_trait_def_id, implements_trait, match_type, paths, return_ty, span_help_and_lint, trait_ref_of_method,

View File

@ -2,11 +2,10 @@
use crate::utils::span_lint_and_then;
use crate::utils::sugg::DiagnosticBuilderExt;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::{Attribute, Name};
declare_clippy_lint! {

View File

@ -1,9 +1,8 @@
//! lint on blocks unnecessarily using >= with a + 1 or - 1
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
use crate::utils::{snippet_opt, span_lint_and_then};

View File

@ -1,9 +1,8 @@
use crate::utils::span_help_and_lint;
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for division of integers

View File

@ -2,9 +2,8 @@
use crate::utils::span_lint;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;
declare_clippy_lint! {

View File

@ -1,12 +1,11 @@
//! lint when there is a large size difference between variants on an enum
use crate::utils::{snippet_opt, span_lint_and_then};
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::layout::LayoutOf;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_clippy_lint! {
/// **What it does:** Checks for large size differences between variants on

View File

@ -1,9 +1,8 @@
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::mir::interpret::ConstValue;
use rustc::ty::{self, ConstKind};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use if_chain::if_chain;

View File

@ -1,12 +1,11 @@
use crate::utils::{get_item_name, snippet_with_applicability, span_lint, span_lint_and_sugg, walk_ptrs_ty};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::Applicability;
use rustc_hir::def_id::DefId;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::{Span, Spanned};
use syntax::ast::{LitKind, Name};

View File

@ -1,14 +1,13 @@
use crate::utils::{higher, qpath_res, snippet, span_lint_and_then};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::def::Res;
use rustc_hir::intravisit;
use rustc_hir::BindingAnnotation;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for variable declarations immediately followed by a

View File

@ -1,8 +1,7 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{is_must_use_func_call, is_must_use_ty, span_help_and_lint};

View File

@ -1,13 +1,12 @@
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir::def::{DefKind, Res};
use rustc_hir::intravisit::*;
use rustc_hir::FunctionRetTy::Return;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rustc_span::symbol::kw;

View File

@ -3,10 +3,9 @@
use crate::utils::{in_macro, snippet_opt, span_lint_and_sugg};
use if_chain::if_chain;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc::{declare_lint_pass, impl_lint_pass};
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass};
use syntax::ast::*;
declare_clippy_lint! {

View File

@ -1,14 +1,13 @@
use crate::reexport::*;
use if_chain::if_chain;
use itertools::Itertools;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::middle::region;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id;
use rustc_hir::intravisit::{walk_block, walk_expr, walk_pat, walk_stmt, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
// use rustc::middle::region::CodeExtent;
use crate::consts::{constant, Constant};
use crate::utils::usage::mutated_variables;

View File

@ -1,7 +1,6 @@
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{Crate, Expr, ExprKind, QPath};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::symbol::sym;
use syntax::ast::AttrKind;

View File

@ -3,12 +3,11 @@
is_copy, match_trait_method, match_type, remove_blocks, snippet_with_applicability, span_lint_and_sugg,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast::Ident;

View File

@ -1,12 +1,11 @@
use crate::utils::paths;
use crate::utils::{iter_input_pats, match_type, method_chain_args, snippet, span_lint_and_then};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self, Ty};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -7,13 +7,12 @@
walk_ptrs_ty,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::ty::{self, Ty};
use rustc_errors::Applicability;
use rustc_hir::def::CtorKind;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use std::cmp::Ordering;
use std::collections::Bound;

View File

@ -1,10 +1,9 @@
use crate::utils::{match_def_path, paths, snippet, span_lint_and_then, walk_ptrs_ty_depth};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::{BorrowKind, Expr, ExprKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use std::iter;

View File

@ -1,8 +1,7 @@
use crate::utils::{match_def_path, paths, qpath_res, span_lint};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{Expr, ExprKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for usage of `std::mem::forget(t)` where `t` is

View File

@ -3,11 +3,10 @@
span_lint_and_sugg, span_lint_and_then,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, QPath};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -9,14 +9,13 @@
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, Lint, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, Lint, LintContext};
use rustc::ty::{self, Predicate, Ty};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::intravisit::{self, Visitor};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rustc_span::symbol::{sym, Symbol, SymbolStr};
use syntax::ast;

View File

@ -1,9 +1,8 @@
use crate::consts::{constant_simple, Constant};
use crate::utils::{match_def_path, paths, span_lint};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use std::cmp::Ordering;
declare_clippy_lint! {

View File

@ -1,12 +1,11 @@
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::intravisit::FnKind;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::{ExpnKind, Span};
use syntax::ast::LitKind;

View File

@ -3,11 +3,10 @@
span_lint_and_then,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast::*;
use syntax::visit::{walk_expr, FnKind, Visitor};

View File

@ -1,11 +1,10 @@
use crate::utils::{has_drop, is_entrypoint_fn, span_lint, trait_ref_of_method};
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass};
use rustc_hir as hir;
use rustc_hir::intravisit::FnKind;
use rustc_hir::{Body, Constness, FnDecl, HirId};
use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
use rustc_typeck::hir_ty_to_ty;

View File

@ -7,11 +7,10 @@
use crate::utils::span_lint;
use if_chain::if_chain;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{LateContext, LateLintPass, LintContext};
use rustc::ty;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use syntax::ast::{self, MetaItem, MetaItemKind};
use syntax::attr;

View File

@ -1,8 +1,7 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{self, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{self, LateContext, LateLintPass, LintContext};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast;

View File

@ -1,11 +1,10 @@
use crate::consts::{constant, Constant};
use crate::utils::{sext, span_lint_and_then};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use std::fmt::Display;
declare_clippy_lint! {

View File

@ -1,8 +1,7 @@
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::*;

View File

@ -1,9 +1,8 @@
//! lint on multiple versions of a crate being used
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::DUMMY_SP;
use syntax::ast::*;

View File

@ -1,9 +1,8 @@
use crate::utils::{match_def_path, paths, span_lint, trait_ref_of_method, walk_ptrs_ty};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{Adt, Dynamic, Opaque, Param, RawPtr, Ref, Ty, TypeAndMut};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -1,11 +1,10 @@
use crate::utils::{higher, span_lint};
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::ty;
use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for instances of `mut mut` references.

View File

@ -1,10 +1,9 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::subst::Subst;
use rustc::ty::{self, Ty};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Detects giving a mutable reference to a function that only

View File

@ -2,11 +2,11 @@
use if_chain::if_chain;
use matches::matches;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, ty};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
declare_clippy_lint! {

View File

@ -3,11 +3,10 @@
//! This lint is **warn** by default
use crate::utils::{match_type, paths, span_lint};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self, Ty};
use rustc_hir::Expr;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast;
declare_clippy_lint! {

View File

@ -4,11 +4,10 @@
use crate::utils::sugg::Sugg;
use crate::utils::{higher, parent_node_is_if_expr, span_lint, span_lint_and_sugg};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Spanned;
use syntax::ast::LitKind;

View File

@ -4,13 +4,12 @@
use crate::utils::{snippet_opt, span_lint_and_then};
use if_chain::if_chain;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc::ty::adjustment::{Adjust, Adjustment};
use rustc_errors::Applicability;
use rustc_hir::{BindingAnnotation, BorrowKind, Expr, ExprKind, HirId, Item, Mutability, Pat, PatKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_clippy_lint! {
/// **What it does:** Checks for address of operations (`&`) that are going to

View File

@ -4,11 +4,10 @@
use crate::utils::{snippet_with_applicability, span_lint_and_then};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::{BindingAnnotation, Mutability, Node, Pat, PatKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for useless borrowed references.

View File

@ -33,9 +33,8 @@
//! ```
//!
//! This lint is **warn** by default.
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::{original_sp, DUMMY_SP};
use std::borrow::Cow;
use syntax::ast;

View File

@ -5,8 +5,7 @@
};
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::traits;
use rustc::traits::misc::can_type_implement_copy;
use rustc::ty::{self, RegionKind, TypeFoldable};
@ -14,7 +13,7 @@
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_hir::intravisit::FnKind;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::{Span, Symbol};
use rustc_target::spec::abi::Abi;
use rustc_typeck::expr_use_visitor as euv;

View File

@ -1,9 +1,8 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::{Expr, ExprKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
/// **What it does:** Checks for needlessly including a base struct on update

View File

@ -1,8 +1,7 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{self, paths, span_lint};

View File

@ -1,8 +1,7 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use crate::consts::{self, Constant};

View File

@ -2,14 +2,13 @@
use crate::utils::sugg::DiagnosticBuilderExt;
use crate::utils::{get_trait_def_id, implements_trait, return_ty, same_tys, span_lint_hir_and_then};
use if_chain::if_chain;
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc::ty::{self, Ty};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::HirIdSet;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
declare_clippy_lint! {

View File

@ -1,10 +1,9 @@
use crate::utils::{has_drop, qpath_res, snippet_opt, span_lint, span_lint_and_sugg};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{BinOpKind, BlockCheckMode, Expr, ExprKind, Stmt, StmtKind, UnsafeSource};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use std::ops::Deref;
declare_clippy_lint! {

Some files were not shown because too many files have changed in this diff Show More