mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Rustup to rust-lang/rust#66878
This commit is contained in:
parent
c66cca44c8
commit
98e433d70d
154 changed files with 308 additions and 151 deletions
|
@ -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;
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
Loading…
Reference in a new issue