resolved conflicts

This commit is contained in:
daubaris 2018-09-01 09:37:42 +03:00
commit 846c3dba2c
525 changed files with 3287 additions and 3156 deletions

View File

@ -170,7 +170,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
reg.register_early_lint_pass(box else_if_without_else::ElseIfWithoutElse);
// ...
reg.register_lint_group("clippy_restriction", vec![
reg.register_lint_group("clippy::restriction", vec![
// ...
else_if_without_else::ELSE_IF_WITHOUT_ELSE,
// ...

View File

@ -13,14 +13,14 @@ A collection of lints to catch common mistakes and improve your [Rust](https://g
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
* `clippy` (everything that has no false positives)
* `clippy_pedantic` (everything)
* `clippy_nursery` (new lints that aren't quite ready yet)
* `clippy_style` (code that should be written in a more idiomatic way)
* `clippy_complexity` (code that does something simple but in a complex way)
* `clippy_perf` (code that can be written in a faster way)
* `clippy_cargo` (checks against the cargo manifest)
* **`clippy_correctness`** (code that is just outright wrong or very very useless)
* `clippy::all` (everything that has no false positives)
* `clippy::pedantic` (everything)
* `clippy::nursery` (new lints that aren't quite ready yet)
* `clippy::style` (code that should be written in a more idiomatic way)
* `clippy::complexity` (code that does something simple but in a complex way)
* `clippy::perf` (code that can be written in a faster way)
* `clippy::cargo` (checks against the cargo manifest)
* **`clippy::correctness`** (code that is just outright wrong or very very useless)
More to come, please [file an issue](https://github.com/rust-lang-nursery/rust-clippy/issues) if you have ideas!
@ -106,26 +106,18 @@ define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
You can add options to `allow`/`warn`/`deny`:
* the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy)]`)
* the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`)
* all lints using both the `clippy` and `clippy_pedantic` lint groups (`#![deny(clippy)]`,
`#![deny(clippy_pedantic)]`). Note that `clippy_pedantic` contains some very aggressive
* all lints using both the `clippy` and `clippy::pedantic` lint groups (`#![deny(clippy::all)]`,
`#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive
lints prone to false positives.
* only some lints (`#![deny(single_match, box_vec)]`, etc)
* only some lints (`#![deny(clippy::single_match, clippy::box_vec)]`, etc)
* `allow`/`warn`/`deny` can be limited to a single function or module using `#[allow(...)]`, etc
Note: `deny` produces errors instead of warnings.
For convenience, `cargo clippy` automatically defines a `cargo-clippy`
feature. This lets you set lint levels and compile with or without Clippy
transparently:
```rust
#[cfg_attr(feature = "cargo-clippy", allow(needless_lifetimes))]
```
## Updating rustc
Sometimes, rustc moves forward without Clippy catching up. Therefore updating

View File

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

View File

@ -1,7 +1,7 @@
use crate::utils::span_lint;
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::source_map::Span;
/// **What it does:** Checks for plain integer arithmetic.

View File

@ -3,7 +3,7 @@
use rustc::hir;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast;
@ -108,7 +108,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
},
hir::ExprKind::Assign(ref assignee, ref e) => {
if let hir::ExprKind::Binary(op, ref l, ref r) = e.node {
#[allow(cyclomatic_complexity)]
#[allow(clippy::cyclomatic_complexity)]
let lint = |assignee: &hir::Expr, rhs: &hir::Expr| {
let ty = cx.tables.expr_ty(assignee);
let rty = cx.tables.expr_ty(rhs);

View File

@ -7,7 +7,7 @@
};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, TyCtxt};
use semver::Version;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast::LitKind;
use syntax::source_map::Span;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use crate::utils::span_lint;

View File

@ -1,6 +1,6 @@
use matches::matches;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use crate::utils::*;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::hir::intravisit::*;
use syntax::ast::{LitKind, NodeId, DUMMY_NODE_ID};
@ -118,7 +118,7 @@ fn run(&mut self, e: &'v Expr) -> Result<Bool, String> {
}
for (n, expr) in self.terminals.iter().enumerate() {
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(e, expr) {
#[allow(cast_possible_truncation)]
#[allow(clippy::cast_possible_truncation)]
return Ok(Bool::Term(n as u8));
}
let negated = match e.node {
@ -150,14 +150,14 @@ fn run(&mut self, e: &'v Expr) -> Result<Bool, String> {
_ => continue,
};
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(&negated, expr) {
#[allow(cast_possible_truncation)]
#[allow(clippy::cast_possible_truncation)]
return Ok(Bool::Not(Box::new(Bool::Term(n as u8))));
}
}
let n = self.terminals.len();
self.terminals.push(e);
if n < 32 {
#[allow(cast_possible_truncation)]
#[allow(clippy::cast_possible_truncation)]
Ok(Bool::Term(n as u8))
} else {
Err("too many literals".to_owned())

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::ast::{Name, UintTy};

View File

@ -13,7 +13,7 @@
//! This lint is **warn** by default
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast;

View File

@ -1,6 +1,6 @@
use syntax::ast::*;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use crate::utils::{in_macro, snippet, span_lint_and_then};
/// **What it does:** Checks for constants with an explicit `'static` lifetime.

View File

@ -1,5 +1,4 @@
#![allow(cast_possible_truncation)]
#![allow(float_cmp)]
#![allow(clippy::float_cmp)]
use rustc::lint::LateContext;
use rustc::{span_bug, bug};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty::Ty;
use rustc::hir::*;
use std::collections::HashMap;

View File

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

View File

@ -2,7 +2,7 @@
use rustc::cfg::CFG;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::ty;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
@ -186,7 +186,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
}
#[cfg(feature = "debugging")]
#[allow(too_many_arguments)]
#[allow(clippy::too_many_arguments)]
fn report_cc_bug(_: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, _: NodeId) {
span_bug!(
span,
@ -200,7 +200,7 @@ fn report_cc_bug(_: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts:
);
}
#[cfg(not(feature = "debugging"))]
#[allow(too_many_arguments)]
#[allow(clippy::too_many_arguments)]
fn report_cc_bug(cx: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, id: NodeId) {
if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
cx.sess().span_note_without_error(

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::TyKind;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use rustc::hir::*;

View File

@ -1,7 +1,7 @@
use itertools::Itertools;
use pulldown_cmark;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast;
use syntax::source_map::{BytePos, Span};
use syntax_pos::Pos;
@ -86,7 +86,7 @@ fn next(&mut self) -> Option<Self::Item> {
/// `syntax::parse::lexer::comments::strip_doc_comment_decoration` because we
/// need to keep track of
/// the spans but this function is inspired from the later.
#[allow(cast_possible_truncation)]
#[allow(clippy::cast_possible_truncation)]
pub fn strip_doc_comment_decoration(comment: &str, span: Span) -> (String, Vec<(usize, Span)>) {
// one-line comments lose their prefix
const ONELINERS: &[&str] = &["///!", "///", "//!", "//"];

View File

@ -2,7 +2,7 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::source_map::Span;
use crate::utils::{snippet, span_lint_and_sugg, SpanlessEq};

View File

@ -1,6 +1,6 @@
use syntax::ast::*;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
/// **What it does:** Checks for unnecessary double parentheses.
///

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use rustc::hir::*;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::source_map::Spanned;

View File

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

View File

@ -1,7 +1,7 @@
//! lint when there is an enum with no variants
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use crate::utils::span_lint_and_then;

View File

@ -1,7 +1,7 @@
use rustc::hir::*;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::source_map::Span;
use crate::utils::SpanlessEq;

View File

@ -2,7 +2,7 @@
//! don't fit into an `i32`
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::ty;
use rustc::ty::subst::Substs;
@ -43,7 +43,7 @@ fn get_lints(&self) -> LintArray {
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
#[allow(cast_possible_truncation, cast_sign_loss)]
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
if cx.tcx.data_layout.pointer_size.bits() != 64 {
return;

View File

@ -3,7 +3,7 @@
use rustc::hir::*;
use rustc::hir::def::Def;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::NodeId;
use syntax::source_map::Span;
use crate::utils::span_lint;

View File

@ -1,7 +1,7 @@
//! lint on enum variants that are prefixed or suffixed by the same characters
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass, Lint};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use syntax::source_map::Span;
use syntax::symbol::LocalInternedString;
@ -147,7 +147,7 @@ fn partial_rmatch(post: &str, name: &str) -> usize {
}
// FIXME: #600
#[allow(while_let_on_iterator)]
#[allow(clippy::while_let_on_iterator)]
fn check_variant(
cx: &EarlyContext<'_>,
threshold: u64,

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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
@ -83,7 +83,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
BinOpKind::Lt | BinOpKind::Le | BinOpKind::Ge | BinOpKind::Gt => (cx.tcx.lang_items().ord_trait(), true),
};
if let Some(trait_id) = trait_id {
#[allow(match_same_arms)]
#[allow(clippy::match_same_arms)]
match (&left.node, &right.node) {
// do not suggest to dereference literals
(&ExprKind::Lit(..), _) | (_, &ExprKind::Lit(..)) => {},

View File

@ -1,7 +1,7 @@
use crate::consts::{constant_simple, Constant};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::source_map::Span;
use crate::utils::{in_macro, span_lint};

View File

@ -1,7 +1,7 @@
use rustc::hir::*;
use rustc::hir::intravisit as visit;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::middle::expr_use_visitor::*;
use rustc::middle::mem_categorization::{cmt_, Categorization};
use rustc::ty::{self, Ty};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use rustc::hir::*;
use crate::utils::{is_adjusted, iter_input_pats, snippet_opt, span_lint_and_then};

View File

@ -2,7 +2,7 @@
use rustc::hir::*;
use rustc::ty;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast;
use crate::utils::{get_parent_expr, span_lint, span_note_and_lint};

View File

@ -1,6 +1,6 @@
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::TyKind;
use std::f32;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir;
use rustc::ty;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::ast::LitKind;

View File

@ -1,5 +1,5 @@
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast;
use crate::utils::{differing_macro_contexts, in_macro, snippet_opt, span_note_and_lint};
use syntax::ptr::P;

View File

@ -2,7 +2,7 @@
use rustc::hir::intravisit;
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use rustc::hir::def::Def;
use std::collections::HashSet;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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};

View File

@ -1,7 +1,7 @@
use crate::consts::{constant_simple, Constant};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::source_map::Span;
use crate::utils::{in_macro, snippet, span_lint, unsext, clip};
use rustc::ty;
@ -59,7 +59,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
}
}
#[allow(cast_possible_wrap)]
#[allow(clippy::cast_possible_wrap)]
fn check(cx: &LateContext<'_, '_>, e: &Expr, m: i8, span: Span, arg: Span) {
if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) {
let check = match cx.tables.expr_ty(e).sty {

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use crate::utils::{match_qpath, paths, snippet, span_lint_and_then};

View File

@ -2,7 +2,7 @@
//! on the condition
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use crate::utils::span_help_and_lint;

View File

@ -6,7 +6,7 @@
use crate::utils::higher::Range;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use syntax::ast::RangeLimits;

View File

@ -1,7 +1,7 @@
use super::utils::{get_arg_name, match_var, remove_blocks, snippet, span_lint_and_sugg};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
/// **What it does:** Checks for matches being used to destructure a single-variant enum

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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.

View File

@ -2,7 +2,7 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use std::collections::HashMap;
use std::default::Default;
use syntax_pos::Span;

View File

@ -1,7 +1,7 @@
//! checks for `#[inline]` on trait methods without bodies
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use syntax::ast::{Attribute, Name};
use crate::utils::span_lint_and_then;

View File

@ -1,7 +1,7 @@
//! lint on blocks unnecessarily using >= with a + 1 or - 1
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use crate::utils::{snippet_opt, span_lint_and_then};
@ -53,7 +53,7 @@ enum Side {
}
impl IntPlusOne {
#[allow(cast_sign_loss)]
#[allow(clippy::cast_sign_loss)]
fn check_lit(&self, lit: &Lit, target_value: i128) -> bool {
if let LitKind::Int(value, ..) = lit.node {
return value == (target_value as u128);

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use rustc::hir::*;

View File

@ -2,7 +2,7 @@
use matches::matches;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use crate::utils::{in_macro, span_lint};

View File

@ -1,7 +1,7 @@
//! lint when there is a large size difference between variants on an enum
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use crate::utils::{snippet_opt, span_lint_and_then};
use rustc::ty::layout::LayoutOf;

View File

@ -1,7 +1,7 @@
use rustc::hir::def_id::DefId;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use std::collections::HashSet;
use syntax::ast::{Lit, LitKind, Name};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir;
use rustc::hir::BindingAnnotation;

View File

@ -5,9 +5,10 @@
#![feature(slice_patterns)]
#![feature(stmt_expr_attributes)]
#![feature(range_contains)]
#![allow(unknown_lints, shadow_reuse, missing_docs_in_private_items)]
#![allow(unknown_lints, clippy::shadow_reuse, clippy::missing_docs_in_private_items)]
#![recursion_limit = "256"]
#![feature(macro_at_most_once_rep)]
#![feature(tool_lints)]
#![warn(rust_2018_idioms)]
use toml;
@ -17,34 +18,34 @@
macro_rules! declare_clippy_lint {
{ pub $name:tt, style, $description:tt } => {
declare_lint! { pub $name, Warn, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
};
{ pub $name:tt, correctness, $description:tt } => {
declare_lint! { pub $name, Deny, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Deny, $description, report_in_external_macro: true }
};
{ pub $name:tt, complexity, $description:tt } => {
declare_lint! { pub $name, Warn, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
};
{ pub $name:tt, perf, $description:tt } => {
declare_lint! { pub $name, Warn, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
};
{ pub $name:tt, pedantic, $description:tt } => {
declare_lint! { pub $name, Allow, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
};
{ pub $name:tt, restriction, $description:tt } => {
declare_lint! { pub $name, Allow, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
};
{ pub $name:tt, cargo, $description:tt } => {
declare_lint! { pub $name, Allow, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
};
{ pub $name:tt, nursery, $description:tt } => {
declare_lint! { pub $name, Allow, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
};
{ pub $name:tt, internal, $description:tt } => {
declare_lint! { pub $name, Allow, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
};
{ pub $name:tt, internal_warn, $description:tt } => {
declare_lint! { pub $name, Warn, $description, report_in_external_macro: true }
declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
};
}
@ -411,7 +412,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
reg.register_late_lint_pass(box non_copy_const::NonCopyConst);
reg.register_late_lint_pass(box ptr_offset_with_cast::Pass);
reg.register_lint_group("clippy_restriction", vec![
reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec![
arithmetic::FLOAT_ARITHMETIC,
arithmetic::INTEGER_ARITHMETIC,
else_if_without_else::ELSE_IF_WITHOUT_ELSE,
@ -434,7 +435,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
write::USE_DEBUG,
]);
reg.register_lint_group("clippy_pedantic", vec![
reg.register_lint_group("clippy::pedantic", Some("clippy_pedantic"), vec![
attrs::INLINE_ALWAYS,
copies::MATCH_SAME_ARMS,
copy_iterator::COPY_ITERATOR,
@ -472,13 +473,13 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
use_self::USE_SELF,
]);
reg.register_lint_group("clippy_internal", vec![
reg.register_lint_group("clippy::internal", Some("clippy_internal"), vec![
utils::internal_lints::CLIPPY_LINTS_INTERNAL,
utils::internal_lints::LINT_WITHOUT_LINT_PASS,
utils::internal_lints::DEFAULT_HASH_TYPES,
]);
reg.register_lint_group("clippy", vec![
reg.register_lint_group("clippy::all", Some("clippy"), vec![
approx_const::APPROX_CONSTANT,
assign_ops::ASSIGN_OP_PATTERN,
assign_ops::MISREFACTORED_ASSIGN_OP,
@ -693,7 +694,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
zero_div_zero::ZERO_DIVIDED_BY_ZERO,
]);
reg.register_lint_group("clippy_style", vec![
reg.register_lint_group("clippy::style", Some("clippy_style"), vec![
assign_ops::ASSIGN_OP_PATTERN,
bit_mask::VERBOSE_BIT_MASK,
blacklisted_name::BLACKLISTED_NAME,
@ -777,7 +778,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
write::WRITELN_EMPTY_STRING,
]);
reg.register_lint_group("clippy_complexity", vec![
reg.register_lint_group("clippy::complexity", Some("clippy_complexity"), vec![
assign_ops::MISREFACTORED_ASSIGN_OP,
booleans::NONMINIMAL_BOOL,
cyclomatic_complexity::CYCLOMATIC_COMPLEXITY,
@ -845,7 +846,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
zero_div_zero::ZERO_DIVIDED_BY_ZERO,
]);
reg.register_lint_group("clippy_correctness", vec![
reg.register_lint_group("clippy::correctness", Some("clippy_correctness"), vec![
approx_const::APPROX_CONSTANT,
attrs::DEPRECATED_SEMVER,
attrs::USELESS_ATTRIBUTE,
@ -899,7 +900,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
unused_io_amount::UNUSED_IO_AMOUNT,
]);
reg.register_lint_group("clippy_perf", vec![
reg.register_lint_group("clippy::perf", Some("clippy_perf"), vec![
bytecount::NAIVE_BYTECOUNT,
entry::MAP_ENTRY,
escape::BOXED_LOCAL,
@ -917,11 +918,11 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
vec::USELESS_VEC,
]);
reg.register_lint_group("clippy_cargo", vec![
reg.register_lint_group("clippy::cargo", Some("clippy_cargo"), vec![
multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
]);
reg.register_lint_group("clippy_nursery", vec![
reg.register_lint_group("clippy::nursery", Some("clippy_nursery"), vec![
attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
fallible_impl_from::FALLIBLE_IMPL_FROM,
mutex_atomic::MUTEX_INTEGER,
@ -933,7 +934,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
// only exists to let the dogfood integration test works.
// Don't run clippy as an executable directly
#[allow(dead_code, print_stdout)]
#[allow(dead_code, clippy::print_stdout)]
fn main() {
panic!("Please use the cargo-clippy executable");
}

View File

@ -1,7 +1,7 @@
use crate::reexport::*;
use matches::matches;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::def::Def;
use rustc::hir::*;
use rustc::hir::intravisit::*;

View File

@ -2,7 +2,7 @@
//! floating-point literal expressions.
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast::*;
use syntax_pos;

View File

@ -5,7 +5,7 @@
use rustc::hir::def_id;
use rustc::hir::intravisit::{walk_block, walk_decl, walk_expr, walk_pat, walk_stmt, NestedVisitorMap, Visitor};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::middle::region;
// use rustc::middle::region::CodeExtent;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use rustc::ty;

View File

@ -1,6 +1,6 @@
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use rustc_errors::Applicability;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use std::cmp::Ordering;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::{Expr, ExprKind};
use crate::utils::{match_def_path, opt_def_id, paths, span_lint};

View File

@ -1,7 +1,7 @@
use matches::matches;
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, Lint, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use rustc::hir::def::Def;
@ -714,7 +714,7 @@ fn get_lints(&self) -> LintArray {
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
#[allow(cyclomatic_complexity)]
#[allow(clippy::cyclomatic_complexity)]
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
if in_macro(expr.span) {
return;
@ -922,7 +922,7 @@ fn check_unwrap_or_default(
}
/// Check for `*or(foo())`.
#[allow(too_many_arguments)]
#[allow(clippy::too_many_arguments)]
fn check_general_case(
cx: &LateContext<'_, '_>,
name: &str,

View File

@ -2,7 +2,7 @@
use crate::utils::{match_def_path, opt_def_id, paths, span_lint};
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use std::cmp::Ordering;
/// **What it does:** Checks for expressions where `std::cmp::min` and `max` are

View File

@ -3,7 +3,7 @@
use rustc::hir::*;
use rustc::hir::intravisit::FnKind;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::source_map::{ExpnFormat, Span};

View File

@ -1,5 +1,5 @@
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass, LintContext, in_external_macro};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use std::collections::HashMap;
use std::char;

View File

@ -20,7 +20,7 @@
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use syntax::ast;
use syntax::attr;

View File

@ -11,7 +11,7 @@
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast;
use syntax::source_map::Span;
use crate::utils::span_lint;

View File

@ -1,7 +1,7 @@
//! lint on multiple versions of a crate being used
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use crate::utils::span_lint;

View File

@ -1,7 +1,7 @@
use rustc::hir;
use rustc::hir::intravisit;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use crate::utils::{higher, span_lint};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty::{self, Ty};
use rustc::ty::subst::Subst;
use rustc::hir::*;

View File

@ -3,7 +3,7 @@
//! This lint is **warn** by default
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty::{self, Ty};
use rustc::hir::Expr;
use syntax::ast;

View File

@ -3,7 +3,7 @@
//! This lint is **warn** by default
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use syntax::ast::LitKind;
use syntax::source_map::Spanned;

View File

@ -3,7 +3,7 @@
//! This lint is **warn** by default
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::{BindingAnnotation, Expr, ExprKind, MutImmutable, Pat, PatKind};
use rustc::ty;

View File

@ -3,7 +3,7 @@
//! This lint is **warn** by default
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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};

View File

@ -28,7 +28,7 @@
//!
//! This lint is **warn** by default.
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast;
use syntax::source_map::{original_sp, DUMMY_SP};
use std::borrow::Cow;

View File

@ -2,7 +2,7 @@
use rustc::hir::*;
use rustc::hir::intravisit::FnKind;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, RegionKind, TypeFoldable};
use rustc::traits;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::ty;
use rustc::hir::{Expr, ExprKind};
use crate::utils::span_lint;

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use crate::utils::{self, paths, span_lint};

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::source_map::{Span, Spanned};
@ -32,7 +32,7 @@ fn get_lints(&self) -> LintArray {
}
}
#[allow(match_same_arms)]
#[allow(clippy::match_same_arms)]
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NegMultiply {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
if let ExprKind::Binary(Spanned { node: BinOpKind::Mul, .. }, ref l, ref r) = e.node {

View File

@ -1,7 +1,7 @@
use rustc::hir::def_id::DefId;
use rustc::hir;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass, in_external_macro, LintContext};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use syntax::source_map::Span;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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};

View File

@ -3,7 +3,7 @@
//! This lint is **deny** by default.
use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use rustc::hir::*;
use rustc::hir::def::Def;
use rustc::ty::{self, TypeFlags};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LintArray, LintPass, EarlyContext, EarlyLintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::source_map::Span;
use syntax::symbol::LocalInternedString;
use syntax::ast::*;
@ -114,6 +114,9 @@ fn visit_pat(&mut self, pat: &'tcx Pat) {
_ => walk_pat(self, pat),
}
}
fn visit_mac(&mut self, _mac: &Mac) {
// do not check macs
}
}
fn get_whitelist(interned_name: &str) -> Option<&'static [&'static str]> {

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_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};

View File

@ -1,6 +1,6 @@
use rustc::hir::{Expr, ExprKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::LitKind;
use syntax::source_map::{Span, Spanned};
use crate::utils::{match_type, paths, span_lint, walk_ptrs_ty};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use crate::utils::{span_lint, SpanlessEq};

View File

@ -1,6 +1,6 @@
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use syntax::ast::LitKind;
use syntax::ptr::P;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use crate::utils::{is_automatically_derived, span_lint};

View File

@ -1,5 +1,5 @@
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use syntax::source_map::Spanned;
use crate::utils::{in_macro, snippet, span_lint_and_sugg};

View File

@ -4,7 +4,7 @@
use rustc::hir::*;
use rustc::hir::QPath;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::ast::NodeId;

View File

@ -1,4 +1,4 @@
use rustc::{declare_lint, hir, lint, lint_array};
use rustc::{declare_tool_lint, hir, lint, lint_array};
use crate::utils;
use std::fmt;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use rustc::hir::def::Def;

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use syntax::ast::RangeLimits;

View File

@ -1,5 +1,5 @@
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use syntax::ast::*;
use crate::utils::{span_lint_and_sugg};

View File

@ -1,6 +1,6 @@
use syntax::ast::{Expr, ExprKind, UnOp};
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use crate::utils::{snippet, span_lint_and_sugg};

View File

@ -1,7 +1,7 @@
use regex_syntax;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use std::collections::HashSet;
use syntax::ast::{LitKind, NodeId, StrStyle};

View File

@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
use rustc::hir;
use rustc::hir::def::Def;

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