all: organize imports
* remove unused imports * separate external and internal imports * consistent import of rustc::lint * move #[allow(unused_imports)] to local impl
This commit is contained in:
parent
997f345046
commit
47b605304d
@ -1,12 +1,8 @@
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::const_eval::lookup_const_by_id;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::Span;
|
||||
use std::f64::consts as f64;
|
||||
|
||||
use utils::span_lint;
|
||||
|
||||
declare_lint! {
|
||||
|
@ -1,11 +1,9 @@
|
||||
/// checks for attributes
|
||||
//! checks for attributes
|
||||
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::{Span, ExpnInfo};
|
||||
use syntax::parse::token::InternedString;
|
||||
use syntax::codemap::ExpnInfo;
|
||||
|
||||
use utils::{in_macro, match_path, span_lint};
|
||||
|
||||
declare_lint! { pub INLINE_ALWAYS, Warn,
|
||||
|
@ -1,11 +1,10 @@
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::const_eval::lookup_const_by_id;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::ast_util::is_comparison_binop;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
use utils::span_lint;
|
||||
|
||||
declare_lint! {
|
||||
|
@ -12,12 +12,10 @@
|
||||
//!
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::{Span, Spanned, ExpnInfo};
|
||||
use syntax::codemap::{Spanned, ExpnInfo};
|
||||
|
||||
use utils::{in_macro, span_help_and_lint, snippet, snippet_block};
|
||||
|
||||
declare_lint! {
|
||||
|
@ -3,6 +3,7 @@ use syntax::ast::*;
|
||||
use syntax::ast_util as ast_util;
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap as code;
|
||||
|
||||
use utils::span_lint;
|
||||
|
||||
declare_lint! {
|
||||
|
@ -1,6 +1,5 @@
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint, Level};
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use syntax::print::pprust::expr_to_string;
|
||||
|
||||
use utils::span_lint;
|
||||
|
@ -1,10 +1,7 @@
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::const_eval::lookup_const_by_id;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
use utils::{span_lint, snippet};
|
||||
|
@ -1,14 +1,9 @@
|
||||
extern crate rustc_typeck as typeck;
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
use syntax::ptr::P;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint};
|
||||
use rustc::util::nodemap::DefIdMap;
|
||||
use rustc::middle::ty::{self, TypeVariants, TypeAndMut, MethodTraitItemId, ImplOrTraitItemId};
|
||||
use rustc::middle::def::{DefTy, DefStruct, DefTrait};
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use rustc::middle::ty::{self, MethodTraitItemId, ImplOrTraitItemId};
|
||||
|
||||
use utils::{span_lint, walk_ptrs_ty, snippet};
|
||||
|
||||
declare_lint!(pub LEN_ZERO, Warn,
|
||||
|
@ -1,7 +1,6 @@
|
||||
#![feature(plugin_registrar, box_syntax)]
|
||||
#![feature(rustc_private, collections)]
|
||||
#![feature(str_split_at)]
|
||||
#![allow(unused_imports, unknown_lints)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate syntax;
|
||||
|
@ -1,10 +1,10 @@
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint};
|
||||
use rustc::lint::*;
|
||||
use syntax::codemap::Span;
|
||||
use syntax::visit::{Visitor, FnKind, walk_ty};
|
||||
use utils::{in_external_macro, span_lint};
|
||||
use syntax::visit::{Visitor, walk_ty};
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
|
||||
use utils::{in_external_macro, span_lint};
|
||||
|
||||
declare_lint!(pub NEEDLESS_LIFETIMES, Warn,
|
||||
"using explicit lifetimes for references in function arguments when elision rules \
|
||||
|
@ -1,5 +1,5 @@
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{Context, LintPass, LintArray};
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::ty;
|
||||
|
||||
use utils::{span_lint, match_def_path, walk_ptrs_ty};
|
||||
|
@ -1,11 +1,11 @@
|
||||
use rustc::lint::*;
|
||||
use syntax::ptr::P;
|
||||
use syntax::ast;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::visit::{FnKind};
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint, Level};
|
||||
use rustc::middle::ty;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use syntax::visit::FnKind;
|
||||
use rustc::middle::ty;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use utils::{match_path, snippet, snippet_block, span_lint, span_help_and_lint, walk_ptrs_ty};
|
||||
|
@ -1,8 +1,8 @@
|
||||
use syntax::ptr::P;
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint};
|
||||
use rustc::middle::ty::{TypeVariants, TypeAndMut, TyRef};
|
||||
use syntax::codemap::{BytePos, ExpnInfo, Span};
|
||||
use syntax::codemap::ExpnInfo;
|
||||
use rustc::middle::ty::{TypeAndMut, TyRef};
|
||||
|
||||
use utils::{in_macro, span_lint};
|
||||
|
||||
declare_lint!(pub MUT_MUT, Warn,
|
||||
|
@ -2,14 +2,9 @@
|
||||
//!
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::const_eval::lookup_const_by_id;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
use utils::{de_p, span_lint, snippet};
|
||||
|
||||
declare_lint! {
|
||||
|
@ -2,14 +2,10 @@
|
||||
//!
|
||||
//! This lint is **warn** by default
|
||||
|
||||
use rustc::plugin::Registry;
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::const_eval::lookup_const_by_id;
|
||||
use rustc::middle::def::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_comparison_binop, binop_to_string};
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::Span;
|
||||
|
||||
use types::match_ty_unwrap;
|
||||
use utils::span_lint;
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
use syntax::ast;
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use syntax::visit::FnKind;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Level};
|
||||
|
||||
use utils::{span_lint, snippet, match_path};
|
||||
|
||||
@ -101,7 +100,7 @@ impl LintPass for ReturnPass {
|
||||
}
|
||||
|
||||
fn check_fn(&mut self, cx: &Context, _: FnKind, _: &FnDecl,
|
||||
block: &Block, _: Span, _: ast::NodeId) {
|
||||
block: &Block, _: Span, _: NodeId) {
|
||||
self.check_block_return(cx, block);
|
||||
self.check_let_return(cx, block);
|
||||
}
|
||||
|
@ -6,9 +6,9 @@
|
||||
use rustc::lint::*;
|
||||
use rustc::middle::ty::TypeVariants::TyStruct;
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::{Span, Spanned};
|
||||
use syntax::codemap::Spanned;
|
||||
|
||||
use eq_op::is_exp_equal;
|
||||
use types::match_ty_unwrap;
|
||||
use utils::{match_def_path, span_lint, walk_ptrs_ty, get_parent_expr};
|
||||
|
||||
declare_lint! {
|
||||
|
@ -1,9 +1,9 @@
|
||||
use syntax::ptr::P;
|
||||
use rustc::lint::*;
|
||||
use syntax::ast;
|
||||
use syntax::ast::*;
|
||||
use syntax::ptr::P;
|
||||
use rustc::middle::ty;
|
||||
use rustc::lint::{Context, LintPass, LintArray, Lint, Level};
|
||||
use syntax::codemap::{ExpnInfo, Span};
|
||||
use syntax::codemap::ExpnInfo;
|
||||
|
||||
use utils::{in_macro, snippet, span_lint, span_help_and_lint};
|
||||
|
||||
@ -40,6 +40,7 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]>
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_imports)]
|
||||
impl LintPass for TypePass {
|
||||
fn get_lints(&self) -> LintArray {
|
||||
lint_array!(BOX_VEC, LINKEDLIST)
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::{BytePos, Span};
|
||||
|
||||
use utils::span_lint;
|
||||
|
||||
declare_lint!{ pub ZERO_WIDTH_SPACE, Deny,
|
||||
|
@ -1,11 +1,10 @@
|
||||
use rustc::lint::{Context, Lint, Level};
|
||||
use syntax::ast::{DefId, Expr, Name, NodeId, Path};
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::*;
|
||||
use syntax::codemap::{ExpnInfo, Span};
|
||||
use syntax::ptr::P;
|
||||
use rustc::ast_map::Node::NodeExpr;
|
||||
use rustc::middle::ty;
|
||||
use std::borrow::{Cow, IntoCow};
|
||||
use std::convert::From;
|
||||
use std::borrow::Cow;
|
||||
|
||||
/// returns true if the macro that expanded the crate was outside of
|
||||
/// the current crate or was a compiler plugin
|
||||
|
Loading…
x
Reference in New Issue
Block a user