Skip to content

Instantly share code, notes, and snippets.

@bltavares
Created April 7, 2016 16:28
Show Gist options
  • Save bltavares/773a335b9344ab5ee2c90bf313adc40e to your computer and use it in GitHub Desktop.
Save bltavares/773a335b9344ab5ee2c90bf313adc40e to your computer and use it in GitHub Desktop.
diff --git src/approx_const.rs src/approx_const.rs
index 822fbd1..731f1a4 100644
--- src/approx_const.rs
+++ src/approx_const.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::f64::consts as f64;
use syntax::ast::{Lit, LitKind, FloatTy};
use utils::span_lint;
diff --git src/array_indexing.rs src/array_indexing.rs
index e5f54c1..ce5c855 100644
--- src/array_indexing.rs
+++ src/array_indexing.rs
@@ -4,7 +4,7 @@ use rustc::ty::TyArray;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
use rustc_const_math::ConstInt;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::RangeLimits;
use utils;
diff --git src/attrs.rs src/attrs.rs
index 363809c..17b8a60 100644
--- src/attrs.rs
+++ src/attrs.rs
@@ -2,7 +2,7 @@
use reexport::*;
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use semver::Version;
use syntax::ast::{Attribute, Lit, LitKind, MetaItemKind};
use syntax::attr::*;
diff --git src/bit_mask.rs src/bit_mask.rs
index cbe601b..42b6eae 100644
--- src/bit_mask.rs
+++ src/bit_mask.rs
@@ -1,8 +1,7 @@
use rustc::lint::*;
-use rustc::middle::def::{Def, PathResolution};
+use rustc::hir::def::{Def, PathResolution};
use rustc_const_eval::lookup_const_by_id;
-use rustc_front::hir::*;
-use rustc_front::util::is_comparison_binop;
+use rustc::hir::*;
use syntax::ast::LitKind;
use syntax::codemap::Span;
use utils::span_lint;
@@ -91,7 +90,7 @@ impl LintPass for BitMask {
impl LateLintPass for BitMask {
fn check_expr(&mut self, cx: &LateContext, e: &Expr) {
if let ExprBinary(ref cmp, ref left, ref right) = e.node {
- if is_comparison_binop(cmp.node) {
+ if cmp.node.is_comparison() {
fetch_int_literal(cx, right).map_or_else(|| {
fetch_int_literal(cx, left).map_or((), |cmp_val| {
check_compare(cx,
diff --git src/blacklisted_name.rs src/blacklisted_name.rs
index 25c0bac..b515da0 100644
--- src/blacklisted_name.rs
+++ src/blacklisted_name.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::span_lint;
/// **What it does:** This lints about usage of blacklisted names.
diff --git src/block_in_if_condition.rs src/block_in_if_condition.rs
index 9cb1196..1a2123f 100644
--- src/block_in_if_condition.rs
+++ src/block_in_if_condition.rs
@@ -1,6 +1,6 @@
use rustc::lint::{LateLintPass, LateContext, LintArray, LintPass};
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, walk_expr};
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, walk_expr};
use utils::*;
/// **What it does:** This lint checks for `if` conditions that use blocks to contain an expression.
diff --git src/booleans.rs src/booleans.rs
index 37ad927..213d12b 100644
--- src/booleans.rs
+++ src/booleans.rs
@@ -1,6 +1,6 @@
use rustc::lint::{LintArray, LateLintPass, LateContext, LintPass};
-use rustc_front::hir::*;
-use rustc_front::intravisit::*;
+use rustc::hir::*;
+use rustc::hir::intravisit::*;
use syntax::ast::{LitKind, DUMMY_NODE_ID};
use syntax::codemap::{DUMMY_SP, dummy_spanned};
use utils::{span_lint_and_then, in_macro, snippet_opt, SpanlessEq};
diff --git src/collapsible_if.rs src/collapsible_if.rs
index 7439730..5674806 100644
--- src/collapsible_if.rs
+++ src/collapsible_if.rs
@@ -13,7 +13,7 @@
//! This lint is **warn** by default
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::borrow::Cow;
use syntax::codemap::Spanned;
diff --git src/consts.rs src/consts.rs
index 73f2bc4..d30392e 100644
--- src/consts.rs
+++ src/consts.rs
@@ -1,10 +1,10 @@
#![allow(cast_possible_truncation)]
use rustc::lint::LateContext;
-use rustc::middle::def::{Def, PathResolution};
+use rustc::hir::def::{Def, PathResolution};
use rustc_const_eval::lookup_const_by_id;
use rustc_const_math::{ConstInt, ConstUsize, ConstIsize};
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::cmp::Ordering::{self, Equal};
use std::cmp::PartialOrd;
use std::hash::{Hash, Hasher};
diff --git src/copies.rs src/copies.rs
index b8eb97c..5b992cf 100644
--- src/copies.rs
+++ src/copies.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use syntax::parse::token::InternedString;
diff --git src/cyclomatic_complexity.rs src/cyclomatic_complexity.rs
index ca5acc6..fcd8980 100644
--- src/cyclomatic_complexity.rs
+++ src/cyclomatic_complexity.rs
@@ -3,8 +3,8 @@
use rustc::lint::*;
use rustc::cfg::CFG;
use rustc::ty;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, walk_expr};
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, walk_expr};
use syntax::ast::Attribute;
use syntax::attr::*;
use syntax::codemap::Span;
diff --git src/derive.rs src/derive.rs
index ab4f73e..593118b 100644
--- src/derive.rs
+++ src/derive.rs
@@ -3,7 +3,7 @@ use rustc::ty::subst::Subst;
use rustc::ty::TypeVariants;
use rustc::ty::fast_reject::simplify_type;
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::{Attribute, MetaItemKind};
use syntax::codemap::Span;
use utils::{CLONE_TRAIT_PATH, HASH_PATH};
diff --git src/drop_ref.rs src/drop_ref.rs
index 7536fb1..3448e05 100644
--- src/drop_ref.rs
+++ src/drop_ref.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::Span;
use utils::DROP_PATH;
use utils::{match_def_path, span_note_and_lint};
diff --git src/entry.rs src/entry.rs
index 8a4cf37..934400b 100644
--- src/entry.rs
+++ src/entry.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, walk_expr, walk_block};
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, walk_expr, walk_block};
use syntax::codemap::Span;
use utils::SpanlessEq;
use utils::{BTREEMAP_PATH, HASHMAP_PATH};
diff --git src/enum_clike.rs src/enum_clike.rs
index 0e2a7a5..e3e8f1e 100644
--- src/enum_clike.rs
+++ src/enum_clike.rs
@@ -3,7 +3,7 @@
use rustc::lint::*;
use rustc::middle::const_val::ConstVal;
use rustc_const_math::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::attr::*;
use utils::span_lint;
diff --git src/enum_glob_use.rs src/enum_glob_use.rs
index 5b29f84..1cfd436 100644
--- src/enum_glob_use.rs
+++ src/enum_glob_use.rs
@@ -1,10 +1,10 @@
//! lint on `use`ing all variants of an enum
-use rustc::front::map::Node::NodeItem;
+use rustc::hir::map::Node::NodeItem;
use rustc::lint::{LateLintPass, LintPass, LateContext, LintArray, LintContext};
-use rustc::middle::def::Def;
+use rustc::hir::def::Def;
use rustc::middle::cstore::DefLike;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::NodeId;
use syntax::codemap::Span;
use utils::span_lint;
diff --git src/eq_op.rs src/eq_op.rs
index 09ac632..00b649e 100644
--- src/eq_op.rs
+++ src/eq_op.rs
@@ -1,6 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
-use rustc_front::util as ast_util;
+use rustc::hir::*;
use utils::{SpanlessEq, span_lint};
/// **What it does:** This lint checks for equal operands to comparison, logical and bitwise,
@@ -34,7 +33,7 @@ impl LateLintPass for EqOp {
span_lint(cx,
EQ_OP,
e.span,
- &format!("equal expressions as operands to `{}`", ast_util::binop_to_string(op.node)));
+ &format!("equal expressions as operands to `{}`", op.node.as_str()));
}
}
}
diff --git src/escape.rs src/escape.rs
index 98500bf..408a3c6 100644
--- src/escape.rs
+++ src/escape.rs
@@ -1,4 +1,4 @@
-use rustc::front::map::Node::{NodeExpr, NodeStmt};
+use rustc::hir::map::Node::{NodeExpr, NodeStmt};
use rustc::lint::*;
use rustc::middle::expr_use_visitor::*;
use rustc::infer;
@@ -7,8 +7,8 @@ use rustc::traits::ProjectionMode;
use rustc::ty::adjustment::AutoAdjustment;
use rustc::ty;
use rustc::util::nodemap::NodeSet;
-use rustc_front::hir::*;
-use rustc_front::intravisit as visit;
+use rustc::hir::*;
+use rustc::hir::intravisit as visit;
use syntax::ast::NodeId;
use syntax::codemap::Span;
use utils::span_lint;
diff --git src/eta_reduction.rs src/eta_reduction.rs
index c080968..4519acc 100644
--- src/eta_reduction.rs
+++ src/eta_reduction.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::{snippet_opt, span_lint_and_then, is_adjusted};
#[allow(missing_copy_implementations)]
diff --git src/format.rs src/format.rs
index 300b3d1..0a349c9 100644
--- src/format.rs
+++ src/format.rs
@@ -1,7 +1,7 @@
-use rustc::front::map::Node::NodeItem;
+use rustc::hir::map::Node::NodeItem;
use rustc::lint::*;
use rustc::ty::TypeVariants;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::LitKind;
use utils::{DISPLAY_FMT_METHOD_PATH, FMT_ARGUMENTS_NEWV1_PATH, STRING_PATH};
use utils::{is_expn_of, match_path, match_type, span_lint, walk_ptrs_ty};
diff --git src/functions.rs src/functions.rs
index 5ac5aae..ed04473 100644
--- src/functions.rs
+++ src/functions.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
-use rustc_front::hir;
-use rustc_front::intravisit;
+use rustc::hir;
+use rustc::hir::intravisit;
use syntax::ast;
use syntax::codemap::Span;
use utils::span_lint;
@@ -45,7 +45,7 @@ impl LintPass for Functions {
impl LateLintPass for Functions {
fn check_fn(&mut self, cx: &LateContext, _: intravisit::FnKind, decl: &hir::FnDecl, _: &hir::Block, span: Span, nodeid: ast::NodeId) {
- use rustc::front::map::Node::*;
+ use rustc::hir::map::Node::*;
if let Some(NodeItem(ref item)) = cx.tcx.map.find(cx.tcx.map.get_parent_node(nodeid)) {
match item.node {
diff --git src/identity_op.rs src/identity_op.rs
index c25047b..4c1f01b 100644
--- src/identity_op.rs
+++ src/identity_op.rs
@@ -1,6 +1,6 @@
use consts::{constant_simple, Constant};
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::Span;
use utils::{span_lint, snippet, in_macro};
use rustc_const_math::ConstInt;
diff --git src/len_zero.rs src/len_zero.rs
index 1a09782..cd3be09 100644
--- src/len_zero.rs
+++ src/len_zero.rs
@@ -1,7 +1,7 @@
use rustc::lint::*;
-use rustc::middle::def_id::DefId;
+use rustc::hir::def_id::DefId;
use rustc::ty::{self, MethodTraitItemId, ImplOrTraitItemId};
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::{Lit, LitKind, Name};
use syntax::codemap::{Span, Spanned};
use syntax::ptr::P;
diff --git src/lib.rs src/lib.rs
index 7ab48f4..1b48c7b 100644
--- src/lib.rs
+++ src/lib.rs
@@ -19,8 +19,6 @@ fn main() {
extern crate syntax;
#[macro_use]
extern crate rustc;
-#[macro_use]
-extern crate rustc_front;
extern crate toml;
diff --git src/lifetimes.rs src/lifetimes.rs
index 72fdba0..72981f6 100644
--- src/lifetimes.rs
+++ src/lifetimes.rs
@@ -1,8 +1,8 @@
use reexport::*;
use rustc::lint::*;
-use rustc::middle::def::Def;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, walk_ty, walk_ty_param_bound, walk_fn_decl, walk_generics};
+use rustc::hir::def::Def;
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, walk_ty, walk_ty_param_bound, walk_fn_decl, walk_generics};
use std::collections::{HashSet, HashMap};
use syntax::codemap::Span;
use utils::{in_external_macro, span_lint};
@@ -207,7 +207,7 @@ fn unique_lifetimes(lts: &[RefLt]) -> usize {
lts.iter().collect::<HashSet<_>>().len()
}
-/// A visitor usable for `rustc_front::visit::walk_ty()`.
+/// A visitor usable for `rustc::hir::visit::walk_ty()`.
struct RefVisitor<'v, 't: 'v> {
cx: &'v LateContext<'v, 't>,
lts: Vec<RefLt>,
diff --git src/loops.rs src/loops.rs
index 20d0fc0..1605947 100644
--- src/loops.rs
+++ src/loops.rs
@@ -1,14 +1,14 @@
use reexport::*;
-use rustc::front::map::Node::NodeBlock;
+use rustc::hir::map::Node::NodeBlock;
use rustc::lint::*;
+use rustc::hir::def::Def;
use rustc::middle::const_val::ConstVal;
-use rustc::middle::def::Def;
use rustc::middle::region::CodeExtent;
use rustc::ty;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, walk_expr, walk_block, walk_decl};
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, walk_expr, walk_block, walk_decl};
use std::borrow::Cow;
use std::collections::HashMap;
use syntax::ast;
diff --git src/map_clone.rs src/map_clone.rs
index 4eac4dc..eeb3aab 100644
--- src/map_clone.rs
+++ src/map_clone.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::{CLONE_PATH, OPTION_PATH};
use utils::{is_adjusted, match_path, match_trait_method, match_type, snippet, span_help_and_lint, walk_ptrs_ty,
walk_ptrs_ty_depth};
diff --git src/matches.rs src/matches.rs
index f1499f7..8b5c196 100644
--- src/matches.rs
+++ src/matches.rs
@@ -4,7 +4,7 @@ use rustc::ty;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
use rustc_const_math::ConstInt;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::cmp::Ordering;
use syntax::ast::LitKind;
use syntax::codemap::Span;
diff --git src/methods.rs src/methods.rs
index 646cd31..a21276e 100644
--- src/methods.rs
+++ src/methods.rs
@@ -5,7 +5,7 @@ use rustc::ty::subst::{Subst, TypeSpace};
use rustc::ty;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::borrow::Cow;
use std::fmt;
use syntax::codemap::Span;
diff --git src/minmax.rs src/minmax.rs
index 0560bf1..67299ba 100644
--- src/minmax.rs
+++ src/minmax.rs
@@ -1,6 +1,6 @@
use consts::{Constant, constant_simple};
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::cmp::{PartialOrd, Ordering};
use syntax::ptr::P;
use utils::{match_def_path, span_lint};
diff --git src/misc.rs src/misc.rs
index a6cfec2..39ac4ab 100644
--- src/misc.rs
+++ src/misc.rs
@@ -4,9 +4,8 @@ use rustc::middle::const_val::ConstVal;
use rustc::ty;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
-use rustc_front::hir::*;
-use rustc_front::intravisit::FnKind;
-use rustc_front::util::{is_comparison_binop, binop_to_string};
+use rustc::hir::*;
+use rustc::hir::intravisit::FnKind;
use syntax::codemap::{Span, Spanned, ExpnFormat};
use syntax::ptr::P;
use utils::{get_item_name, match_path, snippet, get_parent_expr, span_lint};
@@ -105,7 +104,7 @@ impl LintPass for CmpNan {
impl LateLintPass for CmpNan {
fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
if let ExprBinary(ref cmp, ref left, ref right) = expr.node {
- if is_comparison_binop(cmp.node) {
+ if cmp.node.is_comparison() {
if let ExprPath(_, ref path) = left.node {
check_nan(cx, path, expr.span);
}
@@ -170,7 +169,7 @@ impl LateLintPass for FloatCmp {
&format!("{}-comparison of f32 or f64 detected. Consider changing this to `({} - {}).abs() < \
epsilon` for some suitable value of epsilon. \
std::f32::EPSILON and std::f64::EPSILON are available.",
- binop_to_string(op),
+ op.as_str(),
snippet(cx, left.span, ".."),
snippet(cx, right.span, "..")));
}
@@ -217,7 +216,7 @@ impl LintPass for CmpOwned {
impl LateLintPass for CmpOwned {
fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
if let ExprBinary(ref cmp, ref left, ref right) = expr.node {
- if is_comparison_binop(cmp.node) {
+ if cmp.node.is_comparison() {
check_to_owned(cx, left, right, true, cmp.span);
check_to_owned(cx, right, left, false, cmp.span)
}
diff --git src/mut_mut.rs src/mut_mut.rs
index a5ed233..65e2c3a 100644
--- src/mut_mut.rs
+++ src/mut_mut.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty::{TypeAndMut, TyRef};
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::{in_external_macro, span_lint};
/// **What it does:** This lint checks for instances of `mut mut` references.
diff --git src/mut_reference.rs src/mut_reference.rs
index 95ed109..d74c2c4 100644
--- src/mut_reference.rs
+++ src/mut_reference.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty::{TypeAndMut, TypeVariants, MethodCall, TyS};
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ptr::P;
use utils::span_lint;
diff --git src/mutex_atomic.rs src/mutex_atomic.rs
index 0593438..bae1ae3 100644
--- src/mutex_atomic.rs
+++ src/mutex_atomic.rs
@@ -5,7 +5,7 @@
use rustc::lint::{LintPass, LintArray, LateLintPass, LateContext};
use rustc::ty::subst::ParamSpace;
use rustc::ty;
-use rustc_front::hir::Expr;
+use rustc::hir::Expr;
use syntax::ast;
use utils::{span_lint, MUTEX_PATH, match_type};
diff --git src/needless_bool.rs src/needless_bool.rs
index ab5a1e2..07da57c 100644
--- src/needless_bool.rs
+++ src/needless_bool.rs
@@ -3,7 +3,7 @@
//! This lint is **warn** by default
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::LitKind;
use syntax::codemap::Spanned;
use utils::{span_lint, span_lint_and_then, snippet, snippet_opt};
diff --git src/needless_update.rs src/needless_update.rs
index d25f66c..d8ae9dc 100644
--- src/needless_update.rs
+++ src/needless_update.rs
@@ -1,6 +1,6 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty::TyStruct;
-use rustc_front::hir::{Expr, ExprStruct};
+use rustc::hir::{Expr, ExprStruct};
use utils::span_lint;
/// **What it does:** This lint warns on needlessly including a base struct on update when all fields are changed anyway.
diff --git src/new_without_default.rs src/new_without_default.rs
index 395d691..2bcc345 100644
--- src/new_without_default.rs
+++ src/new_without_default.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
-use rustc_front::hir;
-use rustc_front::intravisit::FnKind;
+use rustc::hir;
+use rustc::hir::intravisit::FnKind;
use syntax::ast;
use syntax::codemap::Span;
use utils::{get_trait_def_id, implements_trait, in_external_macro, return_ty, same_tys, span_lint,
diff --git src/no_effect.rs src/no_effect.rs
index 59f7be9..afb4937 100644
--- src/no_effect.rs
+++ src/no_effect.rs
@@ -1,6 +1,6 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc::middle::def::Def;
-use rustc_front::hir::{Expr, Expr_, Stmt, StmtSemi};
+use rustc::hir::def::Def;
+use rustc::hir::{Expr, Expr_, Stmt, StmtSemi};
use utils::{in_macro, span_lint};
/// **What it does:** This lint checks for statements which have no effect.
diff --git src/open_options.rs src/open_options.rs
index e3f61af..3c1e69a 100644
--- src/open_options.rs
+++ src/open_options.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::{Expr, ExprMethodCall, ExprLit};
+use rustc::hir::{Expr, ExprMethodCall, ExprLit};
use syntax::ast::LitKind;
use syntax::codemap::{Span, Spanned};
use utils::{walk_ptrs_ty_depth, match_type, span_lint, OPEN_OPTIONS_PATH};
diff --git src/overflow_check_conditional.rs src/overflow_check_conditional.rs
index 823cb69..627028a 100644
--- src/overflow_check_conditional.rs
+++ src/overflow_check_conditional.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::{span_lint};
/// **What it does:** This lint finds classic underflow / overflow checks.
diff --git src/panic.rs src/panic.rs
index 8b9bf9f..ab03181 100644
--- src/panic.rs
+++ src/panic.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::LitKind;
use utils::{span_lint, is_direct_expn_of, match_path, BEGIN_UNWIND};
diff --git src/print.rs src/print.rs
index ffe20d1..a298d16 100644
--- src/print.rs
+++ src/print.rs
@@ -1,6 +1,6 @@
-use rustc::front::map::Node::{NodeItem, NodeImplItem};
+use rustc::hir::map::Node::{NodeItem, NodeImplItem};
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::{FMT_ARGUMENTV1_NEW_PATH, DEBUG_FMT_METHOD_PATH, IO_PRINT_PATH};
use utils::{is_expn_of, match_path, span_lint};
diff --git src/ptr_arg.rs src/ptr_arg.rs
index 6498db6..8720424 100644
--- src/ptr_arg.rs
+++ src/ptr_arg.rs
@@ -1,9 +1,9 @@
//! Checks for usage of `&Vec[_]` and `&String`.
-use rustc::front::map::NodeItem;
+use rustc::hir::map::NodeItem;
use rustc::lint::*;
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::NodeId;
use utils::{STRING_PATH, VEC_PATH};
use utils::{span_lint, match_type};
diff --git src/ranges.rs src/ranges.rs
index 23bd3d1..c2555da 100644
--- src/ranges.rs
+++ src/ranges.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::Spanned;
use utils::{is_integer_literal, match_type, snippet, span_lint, unsugar_range, UnsugaredRange};
diff --git src/regex.rs src/regex.rs
index 46ee777..12a1415 100644
--- src/regex.rs
+++ src/regex.rs
@@ -3,7 +3,7 @@ use rustc::lint::*;
use rustc::middle::const_val::ConstVal;
use rustc_const_eval::EvalHint::ExprTypeChecked;
use rustc_const_eval::eval_const_expr_partial;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::collections::HashSet;
use std::error::Error;
use syntax::ast::{LitKind, NodeId};
diff --git src/shadow.rs src/shadow.rs
index baf5c9b..928d447 100644
--- src/shadow.rs
+++ src/shadow.rs
@@ -1,8 +1,8 @@
use reexport::*;
use rustc::lint::*;
-use rustc::middle::def::Def;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{Visitor, FnKind};
+use rustc::hir::def::Def;
+use rustc::hir::*;
+use rustc::hir::intravisit::{Visitor, FnKind};
use std::ops::Deref;
use syntax::codemap::Span;
use utils::{is_from_for_desugar, in_external_macro, snippet, span_lint, span_note_and_lint, DiagnosticWrapper};
diff --git src/strings.rs src/strings.rs
index 9f68175..da14566 100644
--- src/strings.rs
+++ src/strings.rs
@@ -4,7 +4,7 @@
//! disable the subsumed lint unless it has a higher level
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::Spanned;
use utils::STRING_PATH;
use utils::SpanlessEq;
diff --git src/swap.rs src/swap.rs
index 6d72122..29db0da 100644
--- src/swap.rs
+++ src/swap.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::mk_sp;
use utils::{differing_macro_contexts, snippet_opt, span_lint_and_then, SpanlessEq};
diff --git src/temporary_assignment.rs src/temporary_assignment.rs
index c945fd7..4479641 100644
--- src/temporary_assignment.rs
+++ src/temporary_assignment.rs
@@ -1,5 +1,5 @@
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc_front::hir::{Expr, ExprAssign, ExprField, ExprStruct, ExprTup, ExprTupField};
+use rustc::hir::{Expr, ExprAssign, ExprField, ExprStruct, ExprTup, ExprTupField};
use utils::is_adjusted;
use utils::span_lint;
diff --git src/transmute.rs src/transmute.rs
index ef049ba..41b92ca 100644
--- src/transmute.rs
+++ src/transmute.rs
@@ -1,7 +1,7 @@
use rustc::lint::*;
use rustc::ty::TypeVariants::{TyRawPtr, TyRef};
use rustc::ty;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::TRANSMUTE_PATH;
use utils::{match_def_path, snippet_opt, span_lint, span_lint_and_then};
diff --git src/types.rs src/types.rs
index cc61845..dee19c9 100644
--- src/types.rs
+++ src/types.rs
@@ -1,10 +1,8 @@
use reexport::*;
use rustc::lint::*;
-use rustc::middle::def;
+use rustc::hir::*;
use rustc::ty;
-use rustc_front::hir::*;
-use rustc_front::intravisit::{FnKind, Visitor, walk_ty};
-use rustc_front::util::{is_comparison_binop, binop_to_string};
+use rustc::hir::intravisit::{FnKind, Visitor, walk_ty};
use std::cmp::Ordering;
use syntax::ast::{IntTy, UintTy, FloatTy};
use syntax::codemap::Span;
@@ -162,7 +160,7 @@ impl LateLintPass for UnitCmp {
if let ExprBinary(ref cmp, ref left, _) = expr.node {
let op = cmp.node;
let sty = &cx.tcx.expr_ty(left).sty;
- if *sty == ty::TyTuple(vec![]) && is_comparison_binop(op) {
+ if *sty == ty::TyTuple(vec![]) && op.is_comparison() {
let result = match op {
BiEq | BiLe | BiGe => "true",
_ => "false",
@@ -171,7 +169,7 @@ impl LateLintPass for UnitCmp {
UNIT_CMP,
expr.span,
&format!("{}-comparison of unit values detected. This will always be {}",
- binop_to_string(op),
+ op.as_str(),
result));
}
}
diff --git src/unicode.rs src/unicode.rs
index 0f21822..2652101 100644
--- src/unicode.rs
+++ src/unicode.rs
@@ -1,5 +1,5 @@
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::LitKind;
use syntax::codemap::Span;
use unicode_normalization::UnicodeNormalization;
diff --git src/unused_label.rs src/unused_label.rs
index f2ecad7..f6ff3c3 100644
--- src/unused_label.rs
+++ src/unused_label.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
-use rustc_front::hir;
-use rustc_front::intravisit::{FnKind, Visitor, walk_expr, walk_fn};
+use rustc::hir;
+use rustc::hir::intravisit::{FnKind, Visitor, walk_expr, walk_fn};
use std::collections::HashMap;
use syntax::ast;
use syntax::codemap::Span;
diff --git src/utils/comparisons.rs src/utils/comparisons.rs
index a9181b3..b890a36 100644
--- src/utils/comparisons.rs
+++ src/utils/comparisons.rs
@@ -1,4 +1,4 @@
-use rustc_front::hir::{BinOp_, Expr};
+use rustc::hir::{BinOp_, Expr};
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub enum Rel {
diff --git src/utils/hir.rs src/utils/hir.rs
index 0659e26..f6fa217 100644
--- src/utils/hir.rs
+++ src/utils/hir.rs
@@ -1,6 +1,6 @@
use consts::constant;
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use std::hash::{Hash, Hasher, SipHasher};
use syntax::ast::Name;
use syntax::ptr::P;
diff --git src/utils/mod.rs src/utils/mod.rs
index 7607ef3..5bb1ba4 100644
--- src/utils/mod.rs
+++ src/utils/mod.rs
@@ -1,15 +1,15 @@
use reexport::*;
-use rustc::front::map::Node;
+use rustc::hir::map::Node;
+use rustc::hir::*;
use rustc::lint::{LintContext, LateContext, Level, Lint};
-use rustc::middle::def_id::DefId;
+use rustc::hir::def_id::DefId;
use rustc::traits;
use rustc::traits::ProjectionMode;
-use rustc::middle::{cstore, def};
+use rustc::middle::cstore;
use rustc::infer;
use rustc::ty;
use rustc::ty::subst::Subst;
use rustc::session::Session;
-use rustc_front::hir::*;
use std::borrow::Cow;
use std::mem;
use std::ops::{Deref, DerefMut};
diff --git src/vec.rs src/vec.rs
index 412ebf3..d27a332 100644
--- src/vec.rs
+++ src/vec.rs
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::ty::TypeVariants;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::codemap::Span;
use syntax::ptr::P;
use utils::VEC_FROM_ELEM_PATH;
diff --git src/zero_div_zero.rs src/zero_div_zero.rs
index f58b0e6..902d84d 100644
--- src/zero_div_zero.rs
+++ src/zero_div_zero.rs
@@ -1,6 +1,6 @@
use consts::{Constant, constant_simple, FloatWidth};
use rustc::lint::*;
-use rustc_front::hir::*;
+use rustc::hir::*;
use utils::span_help_and_lint;
/// `ZeroDivZeroPass` is a pass that checks for a binary expression that consists
diff --git tests/consts.rs tests/consts.rs
index b7b2f6a..4b3aba3 100644
--- tests/consts.rs
+++ tests/consts.rs
@@ -5,12 +5,11 @@ extern crate clippy;
extern crate rustc;
extern crate rustc_const_eval;
extern crate rustc_const_math;
-extern crate rustc_front;
extern crate syntax;
use clippy::consts::{constant_simple, Constant, FloatWidth};
use rustc_const_math::ConstInt;
-use rustc_front::hir::*;
+use rustc::hir::*;
use syntax::ast::{LitIntType, LitKind, StrStyle};
use syntax::codemap::{Spanned, COMMAND_LINE_SP};
use syntax::parse::token::InternedString;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment