This commit is contained in:
Matthias Krüger 2019-12-04 00:16:03 +01:00 committed by flip1995
parent c66cca44c8
commit 98e433d70d
No known key found for this signature in database
GPG key ID: 2CEFCDB27ED0BE79
154 changed files with 308 additions and 151 deletions

View file

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

View file

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

View file

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

View file

@ -2,9 +2,10 @@ use crate::consts::{constant, Constant};
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
declare_clippy_lint! {

View file

@ -1,9 +1,10 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use crate::utils::{
get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, trait_ref_of_method, SpanlessEq,

View file

@ -6,14 +6,15 @@ use crate::utils::{
span_lint_and_then, without_block_comments,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::*;
use rustc::lint::{
in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray,
LintContext, LintPass,
};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use semver::Version;
use syntax::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
use syntax::source_map::Span;

View file

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

View file

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

View file

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

View file

@ -3,11 +3,12 @@ use crate::utils::{
span_lint_and_then, SpanlessEq,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::intravisit::*;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
use syntax::source_map::Span;

View file

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

View file

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

View file

@ -1,10 +1,11 @@
//! 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::hir::*;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq};

View file

@ -2,8 +2,9 @@
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::hir::*;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_session::declare_tool_lint;
use syntax::ast::Attribute;
use syntax::source_map::Span;

View file

@ -13,8 +13,9 @@
//! 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::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::ast;
use crate::utils::sugg::Sugg;

View file

@ -1,9 +1,10 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks comparison chains written with `if` that can be

View file

@ -1,10 +1,11 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::Ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_data_structures::fx::FxHashMap;
use rustc_session::declare_tool_lint;
use std::collections::hash_map::Entry;
use std::hash::BuildHasherDefault;
use syntax::symbol::Symbol;

View file

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

View file

@ -1,7 +1,8 @@
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::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast;
use syntax::source_map::Span;
use syntax::tokenstream::TokenStream;

View file

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

View file

@ -1,10 +1,11 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
declare_clippy_lint! {

View file

@ -2,9 +2,10 @@ use crate::utils::span_lint;
use itertools::Itertools;
use pulldown_cmark;
use rustc::hir;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_data_structures::fx::FxHashSet;
use rustc_session::declare_tool_lint;
use std::ops::Range;
use syntax::ast::{AttrKind, Attribute};
use syntax::source_map::{BytePos, Span};

View file

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

View file

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

View file

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

View file

@ -1,9 +1,10 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks for calls to `std::mem::drop` with a reference

View file

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

View file

@ -1,7 +1,8 @@
//! 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::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View file

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

View file

@ -2,11 +2,12 @@ use crate::utils::SpanlessEq;
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::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
declare_clippy_lint! {

View file

@ -3,13 +3,14 @@
use crate::consts::{miri_to_const, Constant};
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::mir::interpret::GlobalId;
use rustc::ty;
use rustc::ty::subst::InternalSubsts;
use rustc::ty::util::IntTypeExt;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use std::convert::TryFrom;
use syntax::ast::{IntTy, UintTy};

View file

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

View file

@ -2,8 +2,9 @@
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::{declare_tool_lint, impl_lint_pass};
use rustc_session::declare_tool_lint;
use syntax::ast::*;
use syntax::source_map::Span;
use syntax::symbol::Symbol;

View file

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

View file

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

View file

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

View file

@ -1,10 +1,11 @@
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::*;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::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,10 +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::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks for a read and a write to the same variable where

View file

@ -1,11 +1,12 @@
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::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use std::f32;
use std::f64;
use std::fmt;

View file

@ -1,8 +1,9 @@
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::hir::{Expr, ExprKind, Item, ItemKind, Node};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** `exit()` terminates the program and doesn't provide a

View file

@ -1,9 +1,10 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
declare_clippy_lint! {

View file

@ -1,10 +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;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax_pos::Span;
declare_clippy_lint! {

View file

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

View file

@ -1,7 +1,8 @@
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::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::ast::*;
declare_clippy_lint! {

View file

@ -4,11 +4,12 @@ use crate::utils::{
};
use matches::matches;
use rustc::hir::{self, def::Res, def_id::DefId, intravisit};
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_target::spec::abi::Abi;
use syntax::ast::Attribute;
use syntax::source_map::Span;

View file

@ -2,10 +2,11 @@
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::hir::{BinOpKind, Expr, ExprKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
use syntax::source_map::Spanned;
use syntax::symbol::Symbol;

View file

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

View file

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

View file

@ -1,8 +1,9 @@
//! 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::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View file

@ -5,11 +5,12 @@ use crate::utils::{
};
use if_chain::if_chain;
use rustc::{
declare_lint_pass, declare_tool_lint,
declare_lint_pass,
hir::{intravisit::FnKind, Body, Expr, ExprKind, FnDecl, HirId, MatchSource, StmtKind},
lint::{LateContext, LateLintPass, LintArray, LintPass},
};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
declare_clippy_lint! {

View file

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

View file

@ -1,9 +1,10 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks for matches being used to destructure a single-variant enum

View file

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

View file

@ -2,9 +2,10 @@
use crate::utils::{in_macro, span_lint_and_then};
use rustc::hir::*;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_data_structures::fx::FxHashMap;
use rustc_session::declare_tool_lint;
use syntax_pos::Span;
declare_clippy_lint! {

View file

@ -1,7 +1,8 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::{ImplItem, ImplItemKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::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,10 +2,11 @@
use crate::utils::span_lint_and_then;
use crate::utils::sugg::DiagnosticBuilderExt;
use rustc::declare_lint_pass;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::{Attribute, Name};
declare_clippy_lint! {

View file

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

View file

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

View file

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

View file

@ -2,10 +2,11 @@
use crate::utils::{snippet_opt, span_lint_and_then};
use rustc::hir::*;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::layout::LayoutOf;
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks for large size differences between variants on

View file

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

View file

@ -1,11 +1,12 @@
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::hir::def_id::DefId;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::{LitKind, Name};
use syntax::source_map::{Span, Spanned};

View file

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

View file

@ -35,6 +35,8 @@ extern crate rustc_mir;
#[allow(unused_extern_crates)]
extern crate rustc_parse;
#[allow(unused_extern_crates)]
extern crate rustc_session;
#[allow(unused_extern_crates)]
extern crate rustc_target;
#[allow(unused_extern_crates)]
extern crate rustc_typeck;
@ -69,9 +71,11 @@ use toml;
/// # #![feature(rustc_private)]
/// # #[allow(unused_extern_crates)]
/// # extern crate rustc;
/// # #[allow(unused_extern_crates)]
/// # extern crate rustc_session;
/// # #[macro_use]
/// # use clippy_lints::declare_clippy_lint;
/// use rustc::declare_tool_lint;
/// use rustc_session::declare_tool_lint;
///
/// declare_clippy_lint! {
/// /// **What it does:** Checks for ... (describe what the lint matches).

View file

@ -1,10 +1,11 @@
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::def::{DefKind, Res};
use rustc::hir::intravisit::*;
use rustc::hir::*;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
use syntax::symbol::kw;

View file

@ -4,8 +4,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, declare_tool_lint, impl_lint_pass};
use rustc::{declare_lint_pass, impl_lint_pass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::*;
use syntax_pos;

View file

@ -1,13 +1,14 @@
use crate::reexport::*;
use if_chain::if_chain;
use itertools::Itertools;
use rustc::declare_lint_pass;
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::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::middle::region;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
// use rustc::middle::region::CodeExtent;
use crate::consts::{constant, Constant};
use crate::utils::usage::mutated_variables;

View file

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

View file

@ -3,11 +3,12 @@ use crate::utils::{
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::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::Ident;
use syntax::source_map::Span;

View file

@ -1,11 +1,12 @@
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::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
declare_clippy_lint! {

View file

@ -6,12 +6,13 @@ use crate::utils::{
snippet_with_applicability, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::def::CtorKind;
use rustc::hir::*;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty::{self, Ty};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use std::cmp::Ordering;
use std::collections::Bound;
use syntax::ast::LitKind;

View file

@ -1,9 +1,10 @@
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::hir::{BorrowKind, Expr, ExprKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use std::iter;

View file

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

View file

@ -2,10 +2,11 @@ use crate::utils::{
match_def_path, match_qpath, paths, snippet_with_applicability, span_help_and_lint, span_lint_and_sugg,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, QPath};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:** Checks for `mem::replace()` on an `Option` with

View file

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

View file

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

View file

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

View file

@ -3,10 +3,11 @@ use crate::utils::{
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::{declare_lint_pass, declare_tool_lint};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::*;
use syntax::source_map::Span;
use syntax::visit::{walk_expr, FnKind, Visitor};

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,9 @@
//! 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::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use syntax::{ast::*, source_map::DUMMY_SP};
use cargo_metadata;

View file

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

View file

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

View file

@ -4,7 +4,8 @@ use matches::matches;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint, ty};
use rustc::{declare_lint_pass, ty};
use rustc_session::declare_tool_lint;
use syntax_pos::Span;
declare_clippy_lint! {

View file

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

View file

@ -4,10 +4,11 @@
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::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::ast::LitKind;
use syntax::source_map::Spanned;

View file

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

View file

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

View file

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

View file

@ -5,14 +5,15 @@ use crate::utils::{
};
use if_chain::if_chain;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::intravisit::FnKind;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::traits;
use rustc::ty::{self, RegionKind, TypeFoldable};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_target::spec::abi::Abi;
use rustc_typeck::expr_use_visitor as euv;
use std::borrow::Cow;

View file

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

View file

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

View file

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

View file

@ -4,11 +4,12 @@ use crate::utils::{get_trait_def_id, implements_trait, return_ty, same_tys, span
use if_chain::if_chain;
use rustc::hir;
use rustc::hir::def_id::DefId;
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty::{self, Ty};
use rustc::util::nodemap::HirIdSet;
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use syntax::source_map::Span;
declare_clippy_lint! {

View file

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

View file

@ -4,12 +4,13 @@
use std::ptr;
use rustc::declare_lint_pass;
use rustc::hir::def::{DefKind, Res};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass};
use rustc::ty::adjustment::Adjust;
use rustc::ty::{Ty, TypeFlags};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
use rustc_typeck::hir_ty_to_ty;
use syntax_pos::{InnerSpan, Span, DUMMY_SP};

View file

@ -1,6 +1,7 @@
use crate::utils::{span_lint, span_lint_and_then};
use rustc::impl_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, impl_lint_pass};
use rustc_session::declare_tool_lint;
use std::cmp::Ordering;
use syntax::ast::*;
use syntax::attr;

View file

@ -1,8 +1,9 @@
use crate::utils::{match_type, method_chain_args, paths, snippet, span_help_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use rustc_session::declare_tool_lint;
declare_clippy_lint! {
/// **What it does:*** Checks for unnecessary `ok()` in if let.

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