mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Merge branch 'macro-use' into HEAD
This commit is contained in:
commit
1f65617372
@ -21,8 +21,8 @@ edition = "2018"
|
||||
[dependencies]
|
||||
cargo_metadata = "0.5"
|
||||
itertools = "0.7"
|
||||
lazy_static = "1.0"
|
||||
matches = "0.1.2"
|
||||
lazy_static = "1.0.2"
|
||||
matches = "0.1.7"
|
||||
quine-mc_cluskey = "0.2.2"
|
||||
regex-syntax = "0.6"
|
||||
semver = "0.9.0"
|
||||
@ -32,7 +32,7 @@ toml = "0.4"
|
||||
unicode-normalization = "0.1"
|
||||
pulldown-cmark = "0.1"
|
||||
url = "1.7.0"
|
||||
if_chain = "0.1"
|
||||
if_chain = "0.1.3"
|
||||
|
||||
[features]
|
||||
debugging = []
|
||||
|
@ -1,6 +1,7 @@
|
||||
use crate::utils::span_lint;
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use std::f64::consts as f64;
|
||||
use syntax::ast::{FloatTy, Lit, LitKind};
|
||||
use syntax::symbol;
|
||||
|
@ -1,6 +1,7 @@
|
||||
use crate::utils::span_lint;
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::codemap::Span;
|
||||
|
||||
/// **What it does:** Checks for plain integer arithmetic.
|
||||
|
@ -3,6 +3,8 @@ use crate::utils::{higher, sugg};
|
||||
use rustc::hir;
|
||||
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast;
|
||||
|
||||
/// **What it does:** Checks for compound assignment operations (`+=` and
|
||||
|
@ -7,6 +7,8 @@ use crate::utils::{
|
||||
};
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use semver::Version;
|
||||
use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast::LitKind;
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::{span_lint, span_lint_and_then};
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::span_lint;
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
use matches::matches;
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||
use crate::utils::*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::*;
|
||||
use syntax::ast::{LitKind, NodeId, DUMMY_NODE_ID};
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use syntax::ast::{Name, UintTy};
|
||||
use crate::utils::{contains_name, get_pat_name, match_type, paths, single_segment_path, snippet, span_lint_and_sugg,
|
||||
|
@ -13,6 +13,8 @@
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast;
|
||||
|
||||
use crate::utils::{in_macro, snippet_block, span_lint_and_sugg, span_lint_and_then};
|
||||
|
@ -1,5 +1,6 @@
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use crate::utils::{in_macro, snippet, span_lint_and_then};
|
||||
|
||||
/// **What it does:** Checks for constants with an explicit `'static` lifetime.
|
||||
|
@ -2,6 +2,7 @@
|
||||
#![allow(float_cmp)]
|
||||
|
||||
use rustc::lint::LateContext;
|
||||
use rustc::{span_bug, bug};
|
||||
use rustc::hir::def::Def;
|
||||
use rustc::hir::*;
|
||||
use rustc::ty::{self, Ty, TyCtxt, Instance};
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty::Ty;
|
||||
use rustc::hir::*;
|
||||
use std::collections::HashMap;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use rustc::cfg::CFG;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::ty;
|
||||
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::TypeVariants;
|
||||
|
||||
use crate::utils::{any_parent_is_automatically_derived, match_def_path, opt_def_id, paths, span_lint_and_sugg};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::hir::*;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -1,6 +1,7 @@
|
||||
use itertools::Itertools;
|
||||
use pulldown_cmark;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast;
|
||||
use syntax::codemap::{BytePos, Span};
|
||||
use syntax_pos::Pos;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::codemap::Span;
|
||||
|
||||
use crate::utils::{snippet, span_lint_and_sugg, SpanlessEq};
|
||||
|
@ -1,5 +1,6 @@
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
|
||||
/// **What it does:** Checks for unnecessary double parentheses.
|
||||
///
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{is_copy, match_def_path, opt_def_id, paths, span_note_and_lint};
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::codemap::Spanned;
|
||||
|
||||
use crate::consts::{constant, Constant};
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint on if expressions with an else if, but without a final else branch
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
|
||||
use crate::utils::{in_external_macro, span_lint_and_sugg};
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint when there is an enum with no variants
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::span_lint_and_then;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::SpanlessEq;
|
||||
use crate::utils::{get_item_name, match_type, paths, snippet, span_lint_and_then, walk_ptrs_ty};
|
||||
|
@ -2,6 +2,7 @@
|
||||
//! don't fit into an `i32`
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::ty;
|
||||
use rustc::ty::subst::Substs;
|
||||
|
@ -3,6 +3,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::def::Def;
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::NodeId;
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::span_lint;
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint on enum variants that are prefixed or suffixed by the same characters
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::Span;
|
||||
use syntax::symbol::LocalInternedString;
|
||||
|
@ -1,5 +1,6 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use crate::utils::{in_macro, implements_trait, is_copy, multispan_sugg, snippet, span_lint, span_lint_and_then, SpanlessEq};
|
||||
|
||||
/// **What it does:** Checks for equal operands to comparison, logical and
|
||||
|
@ -1,6 +1,7 @@
|
||||
use crate::consts::{constant_simple, Constant};
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::{in_macro, span_lint};
|
||||
|
||||
|
@ -2,6 +2,7 @@ use rustc::hir::*;
|
||||
use rustc::hir::intravisit as visit;
|
||||
use rustc::hir::map::Node::{NodeExpr, NodeStmt};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::middle::expr_use_visitor::*;
|
||||
use rustc::middle::mem_categorization::{cmt_, Categorization};
|
||||
use rustc::ty::{self, Ty};
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{is_adjusted, iter_input_pats, snippet_opt, span_lint_and_then};
|
||||
|
@ -2,6 +2,8 @@ use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||
use rustc::hir::*;
|
||||
use rustc::ty;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast;
|
||||
use crate::utils::{get_parent_expr, span_lint, span_note_and_lint};
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::TypeVariants;
|
||||
use std::f32;
|
||||
use std::f64;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use crate::utils::{is_expn_of, match_def_path, resolve_node, span_lint};
|
||||
use crate::utils::opt_def_id;
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir;
|
||||
use rustc::ty;
|
||||
use syntax_pos::Span;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use syntax::ast::LitKind;
|
||||
use syntax_pos::Span;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast;
|
||||
use crate::utils::{differing_macro_contexts, in_macro, snippet_opt, span_note_and_lint};
|
||||
use syntax::ptr::P;
|
||||
|
@ -1,6 +1,8 @@
|
||||
use matches::matches;
|
||||
use rustc::hir::intravisit;
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use rustc::hir::def::Def;
|
||||
use std::collections::HashSet;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use syntax::ast::NodeId;
|
||||
use crate::utils::{in_macro, match_def_path, match_trait_method, same_tys, snippet, span_lint_and_then};
|
||||
|
@ -1,6 +1,7 @@
|
||||
use crate::consts::{constant_simple, Constant};
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::{in_macro, snippet, span_lint, unsext, clip};
|
||||
use rustc::ty;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{match_qpath, paths, snippet, span_lint_and_then};
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
//! on the condition
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
|
||||
use crate::utils::{in_external_macro, span_help_and_lint};
|
||||
|
@ -6,6 +6,7 @@ use crate::utils::higher;
|
||||
use crate::utils::higher::Range;
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use syntax::ast::RangeLimits;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
use super::utils::{get_arg_name, match_var, remove_blocks, snippet, span_lint_and_sugg};
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
|
||||
/// **What it does:** Checks for matches being used to destructure a single-variant enum
|
||||
/// or tuple struct where a `let` will suffice.
|
||||
|
@ -1,5 +1,6 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use crate::utils::{get_trait_def_id, higher, implements_trait, match_qpath, paths, span_lint};
|
||||
|
||||
/// **What it does:** Checks for iteration that is guaranteed to be infinite.
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use std::collections::HashMap;
|
||||
use std::default::Default;
|
||||
use syntax_pos::Span;
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! checks for `#[inline]` on trait methods without bodies
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use syntax::ast::{Attribute, Name};
|
||||
use crate::utils::span_lint_and_then;
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint on blocks unnecessarily using >= with a + 1 or - 1
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
|
||||
use crate::utils::{snippet_opt, span_lint_and_then};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{match_def_path, opt_def_id, paths, span_help_and_lint};
|
||||
|
@ -1,6 +1,8 @@
|
||||
//! lint when items are used after statements
|
||||
|
||||
use matches::matches;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
use crate::utils::{in_macro, span_lint};
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint when there is a large size difference between variants on an enum
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{snippet_opt, span_lint_and_then};
|
||||
use rustc::ty::layout::LayoutOf;
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use std::collections::HashSet;
|
||||
use syntax::ast::{Lit, LitKind, Name};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir;
|
||||
use rustc::hir::BindingAnnotation;
|
||||
use rustc::hir::def::Def;
|
||||
|
@ -13,25 +13,10 @@
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
#![feature(rust_2018_preview)]
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![allow(macro_use_extern_crate)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc;
|
||||
|
||||
use toml;
|
||||
use rustc_plugin;
|
||||
|
||||
#[macro_use]
|
||||
extern crate matches as matches_macro;
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
#[macro_use]
|
||||
extern crate if_chain;
|
||||
|
||||
macro_rules! declare_clippy_lint {
|
||||
{ pub $name:tt, style, $description:tt } => {
|
||||
|
@ -1,5 +1,7 @@
|
||||
use crate::reexport::*;
|
||||
use matches::matches;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::def::Def;
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::*;
|
||||
|
@ -2,6 +2,8 @@
|
||||
//! floating-point literal expressions.
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast::*;
|
||||
use syntax_pos;
|
||||
use crate::utils::{in_external_macro, snippet_opt, span_lint_and_sugg};
|
||||
|
@ -6,6 +6,8 @@ use rustc::hir::def_id;
|
||||
use rustc::hir::intravisit::{walk_block, walk_decl, walk_expr, walk_pat, walk_stmt, NestedVisitorMap, Visitor};
|
||||
use rustc::hir::map::Node::{NodeBlock, NodeExpr, NodeStmt};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::middle::region;
|
||||
// use rustc::middle::region::CodeExtent;
|
||||
use rustc::middle::expr_use_visitor::*;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use rustc::ty;
|
||||
use syntax::ast;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use rustc_errors::Applicability;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, Ty};
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::Bound;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::{Expr, ExprKind};
|
||||
use crate::utils::{match_def_path, opt_def_id, paths, span_lint};
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
use matches::matches;
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::hir::def::Def;
|
||||
use std::borrow::Cow;
|
||||
|
@ -2,6 +2,7 @@ use crate::consts::{constant_simple, Constant};
|
||||
use crate::utils::{match_def_path, opt_def_id, paths, span_lint};
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
/// **What it does:** Checks for expressions where `std::cmp::min` and `max` are
|
||||
|
@ -1,7 +1,10 @@
|
||||
use crate::reexport::*;
|
||||
use matches::matches;
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::FnKind;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use syntax::codemap::{ExpnFormat, Span};
|
||||
use crate::utils::{get_item_name, get_parent_expr, implements_trait, in_constant, in_macro, is_integer_literal,
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use std::collections::HashMap;
|
||||
use std::char;
|
||||
use syntax::ast::*;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use syntax::ast;
|
||||
use syntax::attr;
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! lint on multiple versions of a crate being used
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
|
||||
use cargo_metadata;
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rustc::hir;
|
||||
use rustc::hir::intravisit;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use crate::utils::{higher, in_external_macro, span_lint};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::ty::subst::Subst;
|
||||
use rustc::hir::*;
|
||||
|
@ -3,6 +3,7 @@
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::hir::Expr;
|
||||
use syntax::ast;
|
||||
|
@ -3,6 +3,7 @@
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use syntax::ast::LitKind;
|
||||
use syntax::codemap::Spanned;
|
||||
|
@ -3,6 +3,8 @@
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::{BindingAnnotation, Expr, ExprKind, MutImmutable, Pat, PatKind};
|
||||
use rustc::ty;
|
||||
use rustc::ty::adjustment::{Adjust, Adjustment};
|
||||
|
@ -3,6 +3,8 @@
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::{BindingAnnotation, MutImmutable, Pat, PatKind};
|
||||
use crate::utils::{in_macro, snippet, span_lint_and_then};
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
//!
|
||||
//! This lint is **warn** by default.
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast;
|
||||
use syntax::codemap::{original_sp, DUMMY_SP};
|
||||
use std::borrow::Cow;
|
||||
|
@ -1,7 +1,10 @@
|
||||
use matches::matches;
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::map::*;
|
||||
use rustc::hir::intravisit::FnKind;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, RegionKind, TypeFoldable};
|
||||
use rustc::traits;
|
||||
use rustc::middle::expr_use_visitor as euv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::ty;
|
||||
use rustc::hir::{Expr, ExprKind};
|
||||
use crate::utils::span_lint;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
|
||||
use crate::utils::{self, paths, span_lint, in_external_macro};
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
|
||||
use crate::consts::{self, Constant};
|
||||
|
@ -1,6 +1,8 @@
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::hir;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty::{self, Ty};
|
||||
use syntax::codemap::Span;
|
||||
use crate::utils::paths;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::def::Def;
|
||||
use rustc::hir::{BinOpKind, BlockCheckMode, Expr, ExprKind, Stmt, StmtKind, UnsafeSource};
|
||||
use crate::utils::{has_drop, in_macro, snippet_opt, span_lint, span_lint_and_sugg};
|
||||
|
@ -3,6 +3,7 @@
|
||||
//! This lint is **deny** by default.
|
||||
|
||||
use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass};
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::def::Def;
|
||||
use rustc::ty::{self, TypeFlags};
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::codemap::Span;
|
||||
use syntax::symbol::LocalInternedString;
|
||||
use syntax::ast::*;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{match_type, method_chain_args, paths, snippet, span_help_and_lint};
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
use rustc::hir::{Expr, ExprKind};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::LitKind;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use crate::utils::{match_type, paths, span_lint, walk_ptrs_ty};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{span_lint, SpanlessEq};
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast::LitKind;
|
||||
use syntax::ptr::P;
|
||||
use syntax::ext::quote::rt::Span;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{is_automatically_derived, span_lint};
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::Spanned;
|
||||
use crate::utils::{in_macro, snippet, span_lint_and_sugg};
|
||||
|
@ -5,6 +5,8 @@ use rustc::hir::*;
|
||||
use rustc::hir::map::NodeItem;
|
||||
use rustc::hir::QPath;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::ty;
|
||||
use syntax::ast::NodeId;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::def::Def;
|
||||
use crate::utils::sugg::Sugg;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir::*;
|
||||
use syntax::ast::RangeLimits;
|
||||
use syntax::codemap::Spanned;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{in_macro, is_range_expression, match_var, span_lint_and_sugg};
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
use syntax::ast::{Expr, ExprKind, UnOp};
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use crate::utils::{snippet, span_lint_and_sugg};
|
||||
|
||||
/// **What it does:** Checks for usage of `*&` and `*&mut` in expressions.
|
||||
|
@ -1,6 +1,8 @@
|
||||
use regex_syntax;
|
||||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use std::collections::HashSet;
|
||||
use syntax::ast::{LitKind, NodeId, StrStyle};
|
||||
use syntax::codemap::{BytePos, Span};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use rustc::hir;
|
||||
use rustc::hir::def::Def;
|
||||
use crate::utils::{match_def_path, span_lint_and_sugg};
|
||||
|
@ -1,4 +1,6 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use if_chain::if_chain;
|
||||
use syntax::ast;
|
||||
use syntax::codemap::Span;
|
||||
use syntax::visit::FnKind;
|
||||
|
@ -1,4 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use crate::utils::{get_trait_def_id, paths, span_lint};
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crate::reexport::*;
|
||||
use rustc::lint::*;
|
||||
use rustc::{declare_lint, lint_array};
|
||||
use rustc::hir::*;
|
||||
use rustc::hir::intravisit::FnKind;
|
||||
use rustc::ty;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user