From 2f2eaf8b7ec5073f64fcfd82f91f2f48081832ee Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 7 Jan 2020 01:39:50 +0900 Subject: [PATCH] Rustup to rust-lang/rust#67886 --- clippy_lints/src/approx_const.rs | 2 +- clippy_lints/src/arithmetic.rs | 2 +- clippy_lints/src/assertions_on_constants.rs | 2 +- clippy_lints/src/assign_ops.rs | 4 ++-- clippy_lints/src/attrs.rs | 2 +- clippy_lints/src/bit_mask.rs | 2 +- clippy_lints/src/blacklisted_name.rs | 2 +- clippy_lints/src/block_in_if_condition.rs | 4 ++-- clippy_lints/src/booleans.rs | 9 +++++---- clippy_lints/src/bytecount.rs | 2 +- clippy_lints/src/checked_conversions.rs | 2 +- clippy_lints/src/cognitive_complexity.rs | 2 +- clippy_lints/src/comparison_chain.rs | 2 +- clippy_lints/src/consts.rs | 10 +++++----- clippy_lints/src/copies.rs | 2 +- clippy_lints/src/copy_iterator.rs | 2 +- clippy_lints/src/default_trait_access.rs | 2 +- clippy_lints/src/derive.rs | 2 +- clippy_lints/src/doc.rs | 2 +- clippy_lints/src/double_comparison.rs | 2 +- clippy_lints/src/drop_bounds.rs | 2 +- clippy_lints/src/drop_forget_ref.rs | 2 +- clippy_lints/src/duration_subsec.rs | 2 +- clippy_lints/src/empty_enum.rs | 2 +- clippy_lints/src/entry.rs | 2 +- clippy_lints/src/enum_clike.rs | 2 +- clippy_lints/src/enum_glob_use.rs | 4 ++-- clippy_lints/src/eq_op.rs | 2 +- clippy_lints/src/erasing_op.rs | 2 +- clippy_lints/src/escape.rs | 6 +++--- clippy_lints/src/eta_reduction.rs | 2 +- clippy_lints/src/eval_order_dependence.rs | 2 +- clippy_lints/src/excessive_precision.rs | 2 +- clippy_lints/src/exit.rs | 2 +- clippy_lints/src/explicit_write.rs | 2 +- clippy_lints/src/fallible_impl_from.rs | 4 ++-- clippy_lints/src/format.rs | 2 +- clippy_lints/src/functions.rs | 18 ++++++++++-------- clippy_lints/src/get_last_with_len.rs | 2 +- clippy_lints/src/identity_conversion.rs | 2 +- clippy_lints/src/identity_op.rs | 2 +- clippy_lints/src/implicit_return.rs | 3 ++- clippy_lints/src/indexing_slicing.rs | 2 +- .../src/infallible_destructuring_match.rs | 2 +- clippy_lints/src/infinite_iter.rs | 2 +- clippy_lints/src/inherent_impl.rs | 2 +- clippy_lints/src/inherent_to_string.rs | 2 +- clippy_lints/src/inline_fn_without_body.rs | 2 +- clippy_lints/src/integer_division.rs | 2 +- clippy_lints/src/large_enum_variant.rs | 2 +- clippy_lints/src/large_stack_arrays.rs | 2 +- clippy_lints/src/len_zero.rs | 4 ++-- clippy_lints/src/let_if_seq.rs | 19 ++++++++++--------- clippy_lints/src/let_underscore.rs | 2 +- clippy_lints/src/lib.rs | 2 ++ clippy_lints/src/lifetimes.rs | 5 +++-- clippy_lints/src/loops.rs | 6 +++--- clippy_lints/src/main_recursion.rs | 2 +- clippy_lints/src/map_clone.rs | 2 +- clippy_lints/src/map_unit_fn.rs | 2 +- clippy_lints/src/matches.rs | 4 ++-- clippy_lints/src/mem_discriminant.rs | 2 +- clippy_lints/src/mem_forget.rs | 2 +- clippy_lints/src/mem_replace.rs | 2 +- .../src/methods/inefficient_to_string.rs | 2 +- .../methods/manual_saturating_arithmetic.rs | 6 +++--- clippy_lints/src/methods/mod.rs | 12 ++++++------ .../src/methods/option_map_unwrap_or.rs | 8 ++++---- .../src/methods/unnecessary_filter_map.rs | 4 ++-- clippy_lints/src/minmax.rs | 2 +- clippy_lints/src/misc.rs | 6 +++--- clippy_lints/src/missing_const_for_fn.rs | 4 ++-- clippy_lints/src/missing_doc.rs | 2 +- clippy_lints/src/missing_inline.rs | 2 +- clippy_lints/src/modulo_arithmetic.rs | 2 +- clippy_lints/src/mul_add.rs | 2 +- clippy_lints/src/mut_key.rs | 2 +- clippy_lints/src/mut_mut.rs | 2 +- clippy_lints/src/mut_reference.rs | 2 +- clippy_lints/src/mutable_debug_assertion.rs | 2 +- clippy_lints/src/mutex_atomic.rs | 2 +- clippy_lints/src/needless_bool.rs | 2 +- clippy_lints/src/needless_borrow.rs | 2 +- clippy_lints/src/needless_borrowed_ref.rs | 2 +- clippy_lints/src/needless_pass_by_value.rs | 2 +- clippy_lints/src/needless_update.rs | 2 +- clippy_lints/src/neg_cmp_op_on_partial_ord.rs | 2 +- clippy_lints/src/neg_multiply.rs | 6 +++--- clippy_lints/src/new_without_default.rs | 6 +++--- clippy_lints/src/no_effect.rs | 4 ++-- clippy_lints/src/non_copy_const.rs | 6 +++--- clippy_lints/src/ok_if_let.rs | 2 +- clippy_lints/src/open_options.rs | 2 +- .../src/overflow_check_conditional.rs | 2 +- clippy_lints/src/panic_unimplemented.rs | 2 +- clippy_lints/src/partialeq_ne_impl.rs | 2 +- clippy_lints/src/path_buf_push_overwrite.rs | 2 +- clippy_lints/src/ptr.rs | 4 ++-- clippy_lints/src/ptr_offset_with_cast.rs | 2 +- clippy_lints/src/question_mark.rs | 4 ++-- clippy_lints/src/ranges.rs | 2 +- clippy_lints/src/redundant_clone.rs | 2 +- .../src/redundant_pattern_matching.rs | 2 +- clippy_lints/src/regex.rs | 2 +- clippy_lints/src/replace_consts.rs | 4 ++-- clippy_lints/src/serde_api.rs | 2 +- clippy_lints/src/shadow.rs | 4 ++-- .../src/slow_vector_initialization.rs | 2 +- clippy_lints/src/strings.rs | 2 +- clippy_lints/src/suspicious_trait_impl.rs | 2 +- clippy_lints/src/swap.rs | 2 +- clippy_lints/src/temporary_assignment.rs | 4 ++-- clippy_lints/src/to_digit_is_some.rs | 2 +- clippy_lints/src/trait_bounds.rs | 2 +- clippy_lints/src/transmute.rs | 2 +- clippy_lints/src/transmuting_null.rs | 2 +- .../src/trivially_copy_pass_by_ref.rs | 4 ++-- clippy_lints/src/try_err.rs | 2 +- clippy_lints/src/types.rs | 6 +++--- clippy_lints/src/unicode.rs | 2 +- clippy_lints/src/unused_io_amount.rs | 2 +- clippy_lints/src/unused_self.rs | 4 ++-- clippy_lints/src/unwrap.rs | 4 ++-- clippy_lints/src/use_self.rs | 6 +++--- clippy_lints/src/utils/author.rs | 4 ++-- clippy_lints/src/utils/comparisons.rs | 2 +- clippy_lints/src/utils/diagnostics.rs | 2 +- clippy_lints/src/utils/higher.rs | 3 ++- clippy_lints/src/utils/hir_utils.rs | 2 +- clippy_lints/src/utils/inspector.rs | 4 ++-- clippy_lints/src/utils/internal_lints.rs | 6 +++--- clippy_lints/src/utils/mod.rs | 18 +++++++++--------- clippy_lints/src/utils/ptr.rs | 2 +- clippy_lints/src/utils/sugg.rs | 2 +- clippy_lints/src/utils/usage.rs | 4 ++-- clippy_lints/src/vec.rs | 2 +- clippy_lints/src/zero_div_zero.rs | 2 +- tests/ui/outer_expn_data.fixed | 4 +++- tests/ui/outer_expn_data.rs | 4 +++- tests/ui/outer_expn_data.stderr | 2 +- 140 files changed, 231 insertions(+), 218 deletions(-) diff --git a/clippy_lints/src/approx_const.rs b/clippy_lints/src/approx_const.rs index b73a40d3badb..e0b94b98dc42 100644 --- a/clippy_lints/src/approx_const.rs +++ b/clippy_lints/src/approx_const.rs @@ -1,7 +1,7 @@ use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::symbol; use std::f64::consts as f64; diff --git a/clippy_lints/src/arithmetic.rs b/clippy_lints/src/arithmetic.rs index dc7a0c63307d..9638cb8fbada 100644 --- a/clippy_lints/src/arithmetic.rs +++ b/clippy_lints/src/arithmetic.rs @@ -1,8 +1,8 @@ use crate::consts::constant_simple; use crate::utils::span_lint; -use rustc::hir; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/assertions_on_constants.rs b/clippy_lints/src/assertions_on_constants.rs index ee4f92925507..555825e484f8 100644 --- a/clippy_lints/src/assertions_on_constants.rs +++ b/clippy_lints/src/assertions_on_constants.rs @@ -3,8 +3,8 @@ use crate::utils::paths; use crate::utils::{is_direct_expn_of, is_expn_of, match_function_call, snippet_opt, span_help_and_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::LitKind; diff --git a/clippy_lints/src/assign_ops.rs b/clippy_lints/src/assign_ops.rs index 5fd6e7ffd59f..f0a2ebfcf3c3 100644 --- a/clippy_lints/src/assign_ops.rs +++ b/clippy_lints/src/assign_ops.rs @@ -1,9 +1,9 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use crate::utils::{ @@ -232,7 +232,7 @@ fn lint_misrefactored_assign_op( #[must_use] fn is_commutative(op: hir::BinOpKind) -> bool { - use rustc::hir::BinOpKind::*; + use rustc_hir::BinOpKind::*; match op { Add | Mul | And | Or | BitXor | BitAnd | BitOr | Eq | Ne => true, Sub | Div | Rem | Shl | Shr | Lt | Le | Ge | Gt => false, diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index b1a364b44270..ff5688f5b7ca 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -7,13 +7,13 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{ in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray, LintContext, LintPass, }; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::symbol::Symbol; diff --git a/clippy_lints/src/bit_mask.rs b/clippy_lints/src/bit_mask.rs index ea7f1054fa17..6f7efa08f19f 100644 --- a/clippy_lints/src/bit_mask.rs +++ b/clippy_lints/src/bit_mask.rs @@ -2,10 +2,10 @@ use crate::consts::{constant, Constant}; use crate::utils::sugg::Sugg; use crate::utils::{span_lint, span_lint_and_then}; use if_chain::if_chain; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::LitKind; diff --git a/clippy_lints/src/blacklisted_name.rs b/clippy_lints/src/blacklisted_name.rs index c3ea889cfa9a..44c058911ab3 100644 --- a/clippy_lints/src/blacklisted_name.rs +++ b/clippy_lints/src/blacklisted_name.rs @@ -1,8 +1,8 @@ use crate::utils::span_lint; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashSet; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/block_in_if_condition.rs b/clippy_lints/src/block_in_if_condition.rs index 18b150391562..2224054af355 100644 --- a/clippy_lints/src/block_in_if_condition.rs +++ b/clippy_lints/src/block_in_if_condition.rs @@ -2,8 +2,8 @@ use crate::utils::*; use matches::matches; use rustc::declare_lint_pass; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { @@ -78,7 +78,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition { } if let Some((check, then, _)) = higher::if_block(&expr) { if let ExprKind::Block(block, _) = &check.kind { - if block.rules == DefaultBlock { + if block.rules == BlockCheckMode::DefaultBlock { if block.stmts.is_empty() { if let Some(ex) = &block.expr { // don't dig into the expression here, just suggest that they remove diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs index 4029d5cabfe6..6d918b3cc4b4 100644 --- a/clippy_lints/src/booleans.rs +++ b/clippy_lints/src/booleans.rs @@ -4,10 +4,11 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; +use rustc::hir::intravisit; use rustc::hir::intravisit::*; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::LitKind; @@ -109,7 +110,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> { // prevent folding of `cfg!` macros and the like if !e.span.from_expansion() { match &e.kind { - ExprKind::Unary(UnNot, inner) => return Ok(Bool::Not(box self.run(inner)?)), + ExprKind::Unary(UnOp::UnNot, inner) => return Ok(Bool::Not(box self.run(inner)?)), ExprKind::Binary(binop, lhs, rhs) => match &binop.node { BinOpKind::Or => return Ok(Bool::Or(self.extract(BinOpKind::Or, &[lhs, rhs], Vec::new())?)), BinOpKind::And => return Ok(Bool::And(self.extract(BinOpKind::And, &[lhs, rhs], Vec::new())?)), @@ -445,7 +446,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> { ExprKind::Binary(binop, _, _) if binop.node == BinOpKind::Or || binop.node == BinOpKind::And => { self.bool_expr(e) }, - ExprKind::Unary(UnNot, inner) => { + ExprKind::Unary(UnOp::UnNot, inner) => { if self.cx.tables.node_types()[inner.hir_id].is_bool() { self.bool_expr(e); } else { @@ -471,7 +472,7 @@ struct NotSimplificationVisitor<'a, 'tcx> { impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> { fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { - if let ExprKind::Unary(UnNot, inner) = &expr.kind { + if let ExprKind::Unary(UnOp::UnNot, inner) = &expr.kind { if let Some(suggestion) = simplify_not(self.cx, inner) { span_lint_and_sugg( self.cx, diff --git a/clippy_lints/src/bytecount.rs b/clippy_lints/src/bytecount.rs index 9a0e56240f11..e70f1f317c30 100644 --- a/clippy_lints/src/bytecount.rs +++ b/clippy_lints/src/bytecount.rs @@ -4,10 +4,10 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::{Name, UintTy}; diff --git a/clippy_lints/src/checked_conversions.rs b/clippy_lints/src/checked_conversions.rs index 05cbd625170e..bc79688eef5b 100644 --- a/clippy_lints/src/checked_conversions.rs +++ b/clippy_lints/src/checked_conversions.rs @@ -2,9 +2,9 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::LitKind; diff --git a/clippy_lints/src/cognitive_complexity.rs b/clippy_lints/src/cognitive_complexity.rs index d766d26dfd95..ae293c76c090 100644 --- a/clippy_lints/src/cognitive_complexity.rs +++ b/clippy_lints/src/cognitive_complexity.rs @@ -1,9 +1,9 @@ //! calculate cognitive complexity and warn about overly complex functions use rustc::hir::intravisit::{walk_expr, FnKind, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::BytePos; diff --git a/clippy_lints/src/comparison_chain.rs b/clippy_lints/src/comparison_chain.rs index 0ee8bb199295..4a239abfb50d 100644 --- a/clippy_lints/src/comparison_chain.rs +++ b/clippy_lints/src/comparison_chain.rs @@ -2,8 +2,8 @@ use crate::utils::{ get_trait_def_id, if_sequence, implements_trait, parent_node_is_if_expr, paths, span_help_and_lint, SpanlessEq, }; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index 331dd5cc0152..86799fde8e60 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -2,13 +2,13 @@ use crate::utils::{clip, higher, sext, unsext}; use if_chain::if_chain; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::*; use rustc::lint::LateContext; use rustc::ty::subst::{Subst, SubstsRef}; use rustc::ty::{self, Ty, TyCtxt}; use rustc::{bug, span_bug}; use rustc_data_structures::sync::Lrc; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_span::symbol::Symbol; use std::cmp::Ordering::{self, Equal}; use std::cmp::PartialOrd; @@ -240,9 +240,9 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { self.expr(value).map(|v| Constant::Repeat(Box::new(v), n)) }, ExprKind::Unary(op, ref operand) => self.expr(operand).and_then(|o| match op { - UnNot => self.constant_not(&o, self.tables.expr_ty(e)), - UnNeg => self.constant_negate(&o, self.tables.expr_ty(e)), - UnDeref => Some(o), + UnOp::UnNot => self.constant_not(&o, self.tables.expr_ty(e)), + UnOp::UnNeg => self.constant_negate(&o, self.tables.expr_ty(e)), + UnOp::UnDeref => Some(o), }), ExprKind::Binary(op, ref left, ref right) => self.binop(op, left, right), ExprKind::Call(ref callee, ref args) => { diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index eab7ffca9db4..c4778c6cf43a 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -1,10 +1,10 @@ use crate::utils::{get_parent_expr, higher, if_sequence, same_tys, snippet, span_lint_and_then, span_note_and_lint}; use crate::utils::{SpanlessEq, SpanlessHash}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::Ty; use rustc_data_structures::fx::FxHashMap; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::symbol::Symbol; use std::collections::hash_map::Entry; diff --git a/clippy_lints/src/copy_iterator.rs b/clippy_lints/src/copy_iterator.rs index c8d8da487856..d7863b0d9a9c 100644 --- a/clippy_lints/src/copy_iterator.rs +++ b/clippy_lints/src/copy_iterator.rs @@ -1,7 +1,7 @@ use crate::utils::{is_copy, match_path, paths, span_note_and_lint}; use rustc::declare_lint_pass; -use rustc::hir::{Item, ItemKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{Item, ItemKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/default_trait_access.rs b/clippy_lints/src/default_trait_access.rs index ceacd41e0de8..62f80ef7652b 100644 --- a/clippy_lints/src/default_trait_access.rs +++ b/clippy_lints/src/default_trait_access.rs @@ -1,9 +1,9 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::{any_parent_is_automatically_derived, match_def_path, paths, span_lint_and_sugg}; diff --git a/clippy_lints/src/derive.rs b/clippy_lints/src/derive.rs index a1a8208241c8..c6215afbbd32 100644 --- a/clippy_lints/src/derive.rs +++ b/clippy_lints/src/derive.rs @@ -2,9 +2,9 @@ use crate::utils::paths; use crate::utils::{is_automatically_derived, is_copy, match_path, span_lint_and_then}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index 644b0ca5b8f9..d7c232eec1a2 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -1,9 +1,9 @@ use crate::utils::{match_type, paths, return_ty, span_lint}; use itertools::Itertools; -use rustc::hir; use rustc::impl_lint_pass; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashSet; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::{BytePos, MultiSpan, Span}; use rustc_span::Pos; diff --git a/clippy_lints/src/double_comparison.rs b/clippy_lints/src/double_comparison.rs index d9035421383e..d2ff544bd034 100644 --- a/clippy_lints/src/double_comparison.rs +++ b/clippy_lints/src/double_comparison.rs @@ -1,9 +1,9 @@ //! Lint on unnecessary double comparisons. Some examples: use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/drop_bounds.rs b/clippy_lints/src/drop_bounds.rs index 7dfc99b5f945..825f3b8de74e 100644 --- a/clippy_lints/src/drop_bounds.rs +++ b/clippy_lints/src/drop_bounds.rs @@ -1,8 +1,8 @@ use crate::utils::{match_def_path, paths, span_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/drop_forget_ref.rs b/clippy_lints/src/drop_forget_ref.rs index a0619f02df1b..324c3f309a4f 100644 --- a/clippy_lints/src/drop_forget_ref.rs +++ b/clippy_lints/src/drop_forget_ref.rs @@ -1,9 +1,9 @@ use crate::utils::{is_copy, match_def_path, paths, qpath_res, span_note_and_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/duration_subsec.rs b/clippy_lints/src/duration_subsec.rs index 6025ce0b2c8c..0ec9cc9084ab 100644 --- a/clippy_lints/src/duration_subsec.rs +++ b/clippy_lints/src/duration_subsec.rs @@ -1,8 +1,8 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Spanned; diff --git a/clippy_lints/src/empty_enum.rs b/clippy_lints/src/empty_enum.rs index 24ab0d595719..f16a71fe63f0 100644 --- a/clippy_lints/src/empty_enum.rs +++ b/clippy_lints/src/empty_enum.rs @@ -2,8 +2,8 @@ use crate::utils::span_lint_and_then; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/entry.rs b/clippy_lints/src/entry.rs index ebd95e5d5b00..44211f37e644 100644 --- a/clippy_lints/src/entry.rs +++ b/clippy_lints/src/entry.rs @@ -4,9 +4,9 @@ use crate::utils::{snippet_with_applicability, span_lint_and_then, walk_ptrs_ty} use if_chain::if_chain; use rustc::declare_lint_pass; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index aaa391077aab..e3f862dc2a37 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -4,10 +4,10 @@ use crate::consts::{miri_to_const, Constant}; use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc::ty::util::IntTypeExt; +use rustc_hir::*; use rustc_session::declare_tool_lint; use std::convert::TryFrom; use syntax::ast::{IntTy, UintTy}; diff --git a/clippy_lints/src/enum_glob_use.rs b/clippy_lints/src/enum_glob_use.rs index 22e19f5cf9ab..6cd3e1c86b47 100644 --- a/clippy_lints/src/enum_glob_use.rs +++ b/clippy_lints/src/enum_glob_use.rs @@ -2,9 +2,9 @@ use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/eq_op.rs b/clippy_lints/src/eq_op.rs index 90b1b2d92cb5..232a26790d0e 100644 --- a/clippy_lints/src/eq_op.rs +++ b/clippy_lints/src/eq_op.rs @@ -1,8 +1,8 @@ use crate::utils::{implements_trait, is_copy, multispan_sugg, snippet, span_lint, span_lint_and_then, SpanlessEq}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/erasing_op.rs b/clippy_lints/src/erasing_op.rs index 5819620d45ae..6ff90315a97c 100644 --- a/clippy_lints/src/erasing_op.rs +++ b/clippy_lints/src/erasing_op.rs @@ -1,6 +1,6 @@ use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/escape.rs b/clippy_lints/src/escape.rs index 695f00396a9f..5500df3db027 100644 --- a/clippy_lints/src/escape.rs +++ b/clippy_lints/src/escape.rs @@ -1,10 +1,10 @@ use rustc::hir::intravisit as visit; -use rustc::hir::HirIdSet; -use rustc::hir::{self, *}; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::layout::LayoutOf; use rustc::ty::{self, Ty}; +use rustc_hir::HirIdSet; +use rustc_hir::{self, *}; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_typeck::expr_use_visitor::*; @@ -93,7 +93,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal { } // TODO: Replace with Map::is_argument(..) when it's fixed -fn is_argument(map: &hir::map::Map<'_>, id: HirId) -> bool { +fn is_argument(map: &rustc::hir::map::Map<'_>, id: HirId) -> bool { match map.find(id) { Some(Node::Binding(_)) => (), _ => return false, diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index acaa432137d0..486200fd3715 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -1,10 +1,10 @@ use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::{ diff --git a/clippy_lints/src/eval_order_dependence.rs b/clippy_lints/src/eval_order_dependence.rs index 27ede8bdfdbf..9c8b77992fe5 100644 --- a/clippy_lints/src/eval_order_dependence.rs +++ b/clippy_lints/src/eval_order_dependence.rs @@ -2,9 +2,9 @@ use crate::utils::{get_parent_expr, span_lint, span_note_and_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/excessive_precision.rs b/clippy_lints/src/excessive_precision.rs index e3bbb94ef117..8c51538d35be 100644 --- a/clippy_lints/src/excessive_precision.rs +++ b/clippy_lints/src/excessive_precision.rs @@ -2,10 +2,10 @@ use crate::utils::span_lint_and_sugg; use crate::utils::sugg::format_numeric_literal; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::symbol::Symbol; use std::f32; diff --git a/clippy_lints/src/exit.rs b/clippy_lints/src/exit.rs index 6acc4fa1f4a0..13c44020363b 100644 --- a/clippy_lints/src/exit.rs +++ b/clippy_lints/src/exit.rs @@ -1,8 +1,8 @@ use crate::utils::{is_entrypoint_fn, match_def_path, paths, qpath_res, span_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind, Item, ItemKind, Node}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{Expr, ExprKind, Item, ItemKind, Node}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/explicit_write.rs b/clippy_lints/src/explicit_write.rs index 46655ca0003e..0a52e252de95 100644 --- a/clippy_lints/src/explicit_write.rs +++ b/clippy_lints/src/explicit_write.rs @@ -1,9 +1,9 @@ use crate::utils::{is_expn_of, match_function_call, paths, span_lint, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::LitKind; diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index 7584615aa2fc..6b6165ce18d1 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -2,9 +2,9 @@ use crate::utils::paths::{BEGIN_PANIC, BEGIN_PANIC_FMT, FROM_TRAIT, OPTION, RESU use crate::utils::{is_expn_of, match_def_path, method_chain_args, span_lint_and_then, walk_ptrs_ty}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::Span; @@ -48,7 +48,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom { fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef<'_>]) { use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; - use rustc::hir::*; + use rustc_hir::*; struct FindPanicUnwrap<'a, 'tcx> { lcx: &'a LateContext<'a, 'tcx>, diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs index 043aedd0efaa..28b4760f0536 100644 --- a/clippy_lints/src/format.rs +++ b/clippy_lints/src/format.rs @@ -5,9 +5,9 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::LitKind; diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs index 3afc631571da..98c6d901d186 100644 --- a/clippy_lints/src/functions.rs +++ b/clippy_lints/src/functions.rs @@ -4,12 +4,14 @@ use crate::utils::{ type_is_unsafe_function, }; use matches::matches; -use rustc::hir::{self, def::Res, def_id::DefId, intravisit}; +use rustc::hir::intravisit; use rustc::impl_lint_pass; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::{def::Res, def_id::DefId}; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_target::spec::abi::Abi; @@ -199,16 +201,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions { }; let unsafety = match kind { - hir::intravisit::FnKind::ItemFn(_, _, hir::FnHeader { unsafety, .. }, _, _) => unsafety, - hir::intravisit::FnKind::Method(_, sig, _, _) => sig.header.unsafety, - hir::intravisit::FnKind::Closure(_) => return, + intravisit::FnKind::ItemFn(_, _, hir::FnHeader { unsafety, .. }, _, _) => unsafety, + intravisit::FnKind::Method(_, sig, _, _) => sig.header.unsafety, + intravisit::FnKind::Closure(_) => return, }; // don't warn for implementations, it's not their fault if !is_impl { // don't lint extern functions decls, it's not their fault either match kind { - hir::intravisit::FnKind::Method( + intravisit::FnKind::Method( _, &hir::FnSig { header: hir::FnHeader { abi: Abi::Rust, .. }, @@ -217,7 +219,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions { _, _, ) - | hir::intravisit::FnKind::ItemFn(_, _, hir::FnHeader { abi: Abi::Rust, .. }, _, _) => { + | intravisit::FnKind::ItemFn(_, _, hir::FnHeader { abi: Abi::Rust, .. }, _, _) => { self.check_arg_number(cx, decl, span.with_hi(decl.output.span().hi())) }, _ => {}, @@ -397,7 +399,7 @@ impl<'a, 'tcx> Functions { tables, }; - hir::intravisit::walk_expr(&mut v, expr); + intravisit::walk_expr(&mut v, expr); } } } @@ -557,7 +559,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> { } } }, - hir::ExprKind::Unary(hir::UnDeref, ref ptr) => self.check_arg(ptr), + hir::ExprKind::Unary(hir::UnOp::UnDeref, ref ptr) => self.check_arg(ptr), _ => (), } diff --git a/clippy_lints/src/get_last_with_len.rs b/clippy_lints/src/get_last_with_len.rs index c56fde869227..c9939bc5d7c4 100644 --- a/clippy_lints/src/get_last_with_len.rs +++ b/clippy_lints/src/get_last_with_len.rs @@ -3,9 +3,9 @@ use crate::utils::{is_type_diagnostic_item, snippet_with_applicability, span_lint_and_sugg, SpanlessEq}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{BinOpKind, Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_session::declare_tool_lint; use rustc_span::source_map::Spanned; use rustc_span::symbol::Symbol; diff --git a/clippy_lints/src/identity_conversion.rs b/clippy_lints/src/identity_conversion.rs index c266c496090c..54cf499ae3bc 100644 --- a/clippy_lints/src/identity_conversion.rs +++ b/clippy_lints/src/identity_conversion.rs @@ -1,10 +1,10 @@ use crate::utils::{ match_def_path, match_trait_method, paths, same_tys, snippet, snippet_with_macro_callsite, span_lint_and_then, }; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/identity_op.rs b/clippy_lints/src/identity_op.rs index 6fe33d352a49..b6d02ff9e76d 100644 --- a/clippy_lints/src/identity_op.rs +++ b/clippy_lints/src/identity_op.rs @@ -1,7 +1,7 @@ use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/implicit_return.rs b/clippy_lints/src/implicit_return.rs index be1c80a5ac18..f5633d51aa4e 100644 --- a/clippy_lints/src/implicit_return.rs +++ b/clippy_lints/src/implicit_return.rs @@ -6,10 +6,11 @@ use crate::utils::{ use if_chain::if_chain; use rustc::{ declare_lint_pass, - hir::{intravisit::FnKind, Body, Expr, ExprKind, FnDecl, HirId, MatchSource, StmtKind}, + hir::intravisit::FnKind, lint::{LateContext, LateLintPass, LintArray, LintPass}, }; use rustc_errors::Applicability; +use rustc_hir::{Body, Expr, ExprKind, FnDecl, HirId, MatchSource, StmtKind}; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/indexing_slicing.rs b/clippy_lints/src/indexing_slicing.rs index 837df9f3808e..9083f5823aad 100644 --- a/clippy_lints/src/indexing_slicing.rs +++ b/clippy_lints/src/indexing_slicing.rs @@ -5,9 +5,9 @@ use crate::utils; use crate::utils::higher; use crate::utils::higher::Range; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::RangeLimits; diff --git a/clippy_lints/src/infallible_destructuring_match.rs b/clippy_lints/src/infallible_destructuring_match.rs index 26695a66894d..c75aa8a30e49 100644 --- a/clippy_lints/src/infallible_destructuring_match.rs +++ b/clippy_lints/src/infallible_destructuring_match.rs @@ -1,9 +1,9 @@ use super::utils::{get_arg_name, match_var, remove_blocks, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/infinite_iter.rs b/clippy_lints/src/infinite_iter.rs index 74d4d9c072bd..25c97d5af80e 100644 --- a/clippy_lints/src/infinite_iter.rs +++ b/clippy_lints/src/infinite_iter.rs @@ -1,6 +1,6 @@ use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::{get_trait_def_id, higher, implements_trait, match_qpath, match_type, paths, span_lint}; diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index ff35b81042b7..c162de3ad8c4 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -1,10 +1,10 @@ //! lint on inherent implementations use crate::utils::{in_macro, span_lint_and_then}; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashMap; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::Span; diff --git a/clippy_lints/src/inherent_to_string.rs b/clippy_lints/src/inherent_to_string.rs index 150a9ea9c967..01e81762b4c1 100644 --- a/clippy_lints/src/inherent_to_string.rs +++ b/clippy_lints/src/inherent_to_string.rs @@ -1,7 +1,7 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{ImplItem, ImplItemKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{ImplItem, ImplItemKind}; use rustc_session::declare_tool_lint; use crate::utils::{ diff --git a/clippy_lints/src/inline_fn_without_body.rs b/clippy_lints/src/inline_fn_without_body.rs index c87fc2824de2..4ffc45703edc 100644 --- a/clippy_lints/src/inline_fn_without_body.rs +++ b/clippy_lints/src/inline_fn_without_body.rs @@ -3,9 +3,9 @@ use crate::utils::span_lint_and_then; use crate::utils::sugg::DiagnosticBuilderExt; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::{Attribute, Name}; diff --git a/clippy_lints/src/integer_division.rs b/clippy_lints/src/integer_division.rs index 57c9a8537452..feb9fac93c9d 100644 --- a/clippy_lints/src/integer_division.rs +++ b/clippy_lints/src/integer_division.rs @@ -1,8 +1,8 @@ use crate::utils::span_help_and_lint; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/large_enum_variant.rs b/clippy_lints/src/large_enum_variant.rs index fe3bcf0ab826..f2638d598799 100644 --- a/clippy_lints/src/large_enum_variant.rs +++ b/clippy_lints/src/large_enum_variant.rs @@ -1,11 +1,11 @@ //! lint when there is a large size difference between variants on an enum use crate::utils::{snippet_opt, span_lint_and_then}; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::layout::LayoutOf; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/large_stack_arrays.rs b/clippy_lints/src/large_stack_arrays.rs index f5d5c95ed7aa..86abf72e06d0 100644 --- a/clippy_lints/src/large_stack_arrays.rs +++ b/clippy_lints/src/large_stack_arrays.rs @@ -1,8 +1,8 @@ -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::mir::interpret::ConstValue; use rustc::ty::{self, ConstKind}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use if_chain::if_chain; diff --git a/clippy_lints/src/len_zero.rs b/clippy_lints/src/len_zero.rs index 9463c14379f6..653e82a23388 100644 --- a/clippy_lints/src/len_zero.rs +++ b/clippy_lints/src/len_zero.rs @@ -1,11 +1,11 @@ use crate::utils::{get_item_name, snippet_with_applicability, span_lint, span_lint_and_sugg, walk_ptrs_ty}; use rustc::declare_lint_pass; -use rustc::hir::def_id::DefId; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_hir::def_id::DefId; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::{Span, Spanned}; use syntax::ast::{LitKind, Name}; diff --git a/clippy_lints/src/let_if_seq.rs b/clippy_lints/src/let_if_seq.rs index 4ac88d573f3f..b966c68e7cd2 100644 --- a/clippy_lints/src/let_if_seq.rs +++ b/clippy_lints/src/let_if_seq.rs @@ -1,11 +1,12 @@ use crate::utils::{higher, qpath_res, snippet, span_lint_and_then}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; -use rustc::hir::def::Res; -use rustc::hir::BindingAnnotation; +use rustc::hir::intravisit; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::def::Res; +use rustc_hir::BindingAnnotation; use rustc_session::declare_tool_lint; declare_clippy_lint! { @@ -142,7 +143,7 @@ struct UsedVisitor<'a, 'tcx> { used: bool, } -impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> { +impl<'a, 'tcx> intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> { fn visit_expr(&mut self, expr: &'tcx hir::Expr<'_>) { if_chain! { if let hir::ExprKind::Path(ref qpath) = expr.kind; @@ -153,10 +154,10 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> { return; } } - hir::intravisit::walk_expr(self, expr); + intravisit::walk_expr(self, expr); } - fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> { - hir::intravisit::NestedVisitorMap::None + fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, 'tcx> { + intravisit::NestedVisitorMap::None } } @@ -181,7 +182,7 @@ fn check_assign<'a, 'tcx>( }; for s in block.stmts.iter().take(block.stmts.len()-1) { - hir::intravisit::walk_stmt(&mut v, s); + intravisit::walk_stmt(&mut v, s); if v.used { return None; @@ -197,6 +198,6 @@ fn check_assign<'a, 'tcx>( fn used_in_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, id: hir::HirId, expr: &'tcx hir::Expr<'_>) -> bool { let mut v = UsedVisitor { cx, id, used: false }; - hir::intravisit::walk_expr(&mut v, expr); + intravisit::walk_expr(&mut v, expr); v.used } diff --git a/clippy_lints/src/let_underscore.rs b/clippy_lints/src/let_underscore.rs index 4933b3049c28..f75711a28c3f 100644 --- a/clippy_lints/src/let_underscore.rs +++ b/clippy_lints/src/let_underscore.rs @@ -1,7 +1,7 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::{is_must_use_func_call, is_must_use_ty, span_help_and_lint}; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 4a0976fe8007..5b68ecf562bc 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -26,6 +26,8 @@ extern crate rustc_driver; #[allow(unused_extern_crates)] extern crate rustc_errors; #[allow(unused_extern_crates)] +extern crate rustc_hir; +#[allow(unused_extern_crates)] extern crate rustc_index; #[allow(unused_extern_crates)] extern crate rustc_lexer; diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index 93325ff2d037..0c72c9c6aa04 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -1,10 +1,11 @@ use matches::matches; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; use rustc::hir::intravisit::*; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::FunctionRetTy::Return; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::symbol::kw; diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index 764dbdef4dce..acff3e2f7409 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -2,12 +2,12 @@ use crate::reexport::*; use if_chain::if_chain; use itertools::Itertools; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::def_id; use rustc::hir::intravisit::{walk_block, walk_expr, walk_pat, walk_stmt, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::middle::region; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::def_id; +use rustc_hir::*; use rustc_session::declare_tool_lint; // use rustc::middle::region::CodeExtent; use crate::consts::{constant, Constant}; diff --git a/clippy_lints/src/main_recursion.rs b/clippy_lints/src/main_recursion.rs index 324bdcd3e242..31b2dbf2ae4b 100644 --- a/clippy_lints/src/main_recursion.rs +++ b/clippy_lints/src/main_recursion.rs @@ -1,6 +1,6 @@ -use rustc::hir::{Crate, Expr, ExprKind, QPath}; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{Crate, Expr, ExprKind, QPath}; use rustc_session::declare_tool_lint; use rustc_span::symbol::sym; use syntax::ast::AttrKind; diff --git a/clippy_lints/src/map_clone.rs b/clippy_lints/src/map_clone.rs index d705a69743b4..0c66ce5dde55 100644 --- a/clippy_lints/src/map_clone.rs +++ b/clippy_lints/src/map_clone.rs @@ -4,10 +4,10 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::Ident; diff --git a/clippy_lints/src/map_unit_fn.rs b/clippy_lints/src/map_unit_fn.rs index 156de9bc748a..d0164e5e2907 100644 --- a/clippy_lints/src/map_unit_fn.rs +++ b/clippy_lints/src/map_unit_fn.rs @@ -2,10 +2,10 @@ use crate::utils::paths; use crate::utils::{iter_input_pats, match_type, method_chain_args, snippet, span_lint_and_then}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 68571115ee2c..476051500f56 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -7,11 +7,11 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::def::CtorKind; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir::def::CtorKind; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use std::cmp::Ordering; diff --git a/clippy_lints/src/mem_discriminant.rs b/clippy_lints/src/mem_discriminant.rs index 881ade8cd3fc..22797c3b754c 100644 --- a/clippy_lints/src/mem_discriminant.rs +++ b/clippy_lints/src/mem_discriminant.rs @@ -1,9 +1,9 @@ use crate::utils::{match_def_path, paths, snippet, span_lint_and_then, walk_ptrs_ty_depth}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{BorrowKind, Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::{BorrowKind, Expr, ExprKind}; use rustc_session::declare_tool_lint; use std::iter; diff --git a/clippy_lints/src/mem_forget.rs b/clippy_lints/src/mem_forget.rs index 4c3ba21e4f9d..974f6419ee69 100644 --- a/clippy_lints/src/mem_forget.rs +++ b/clippy_lints/src/mem_forget.rs @@ -1,7 +1,7 @@ use crate::utils::{match_def_path, paths, qpath_res, span_lint}; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs index d00ee4940d7e..e6b50e546ad0 100644 --- a/clippy_lints/src/mem_replace.rs +++ b/clippy_lints/src/mem_replace.rs @@ -4,9 +4,9 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, QPath}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, QPath}; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/methods/inefficient_to_string.rs b/clippy_lints/src/methods/inefficient_to_string.rs index 47a77b011e45..83c63ec752f9 100644 --- a/clippy_lints/src/methods/inefficient_to_string.rs +++ b/clippy_lints/src/methods/inefficient_to_string.rs @@ -1,10 +1,10 @@ use super::INEFFICIENT_TO_STRING; use crate::utils::{match_def_path, paths, snippet_with_applicability, span_lint_and_then, walk_ptrs_ty_depth}; use if_chain::if_chain; -use rustc::hir; use rustc::lint::LateContext; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir as hir; /// Checks for the `INEFFICIENT_TO_STRING` lint pub fn lint<'tcx>(cx: &LateContext<'_, 'tcx>, expr: &hir::Expr<'_>, arg: &hir::Expr<'_>, arg_ty: Ty<'tcx>) { diff --git a/clippy_lints/src/methods/manual_saturating_arithmetic.rs b/clippy_lints/src/methods/manual_saturating_arithmetic.rs index e6ffa3328820..7f2152e294a7 100644 --- a/clippy_lints/src/methods/manual_saturating_arithmetic.rs +++ b/clippy_lints/src/methods/manual_saturating_arithmetic.rs @@ -1,8 +1,8 @@ use crate::utils::{match_qpath, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; -use rustc::hir; use rustc::lint::LateContext; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_target::abi::LayoutOf; use syntax::ast; @@ -146,7 +146,7 @@ fn is_min_or_max<'tcx>(cx: &LateContext<'_, 'tcx>, expr: &hir::Expr<'_>) -> Opti } if ty.is_signed() { - if let hir::ExprKind::Unary(hir::UnNeg, val) = &expr.kind { + if let hir::ExprKind::Unary(hir::UnOp::UnNeg, val) = &expr.kind { return check_lit(val, true); } } @@ -161,7 +161,7 @@ enum Sign { } fn lit_sign(expr: &hir::Expr<'_>) -> Option { - if let hir::ExprKind::Unary(hir::UnNeg, inner) = &expr.kind { + if let hir::ExprKind::Unary(hir::UnOp::UnNeg, inner) = &expr.kind { if let hir::ExprKind::Lit(..) = &inner.kind { return Some(Sign::Neg); } diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 27a8b61fdbae..c33dae6c283d 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -10,11 +10,11 @@ use std::iter; use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit::{self, Visitor}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, Lint, LintArray, LintContext, LintPass}; use rustc::ty::{self, Predicate, Ty}; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::symbol::{sym, Symbol, SymbolStr}; @@ -3163,11 +3163,11 @@ impl OutType { fn matches(self, cx: &LateContext<'_, '_>, ty: &hir::FunctionRetTy<'_>) -> bool { let is_unit = |ty: &hir::Ty<'_>| SpanlessEq::new(cx).eq_ty_kind(&ty.kind, &hir::TyKind::Tup(&[])); match (self, ty) { - (Self::Unit, &hir::DefaultReturn(_)) => true, - (Self::Unit, &hir::Return(ref ty)) if is_unit(ty) => true, - (Self::Bool, &hir::Return(ref ty)) if is_bool(ty) => true, - (Self::Any, &hir::Return(ref ty)) if !is_unit(ty) => true, - (Self::Ref, &hir::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)), + (Self::Unit, &hir::FunctionRetTy::DefaultReturn(_)) => true, + (Self::Unit, &hir::FunctionRetTy::Return(ref ty)) if is_unit(ty) => true, + (Self::Bool, &hir::FunctionRetTy::Return(ref ty)) if is_bool(ty) => true, + (Self::Any, &hir::FunctionRetTy::Return(ref ty)) if !is_unit(ty) => true, + (Self::Ref, &hir::FunctionRetTy::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)), _ => false, } } diff --git a/clippy_lints/src/methods/option_map_unwrap_or.rs b/clippy_lints/src/methods/option_map_unwrap_or.rs index 696f74d36dba..c9cb17e965eb 100644 --- a/clippy_lints/src/methods/option_map_unwrap_or.rs +++ b/clippy_lints/src/methods/option_map_unwrap_or.rs @@ -1,10 +1,10 @@ use crate::utils::{differing_macro_contexts, paths, snippet_with_applicability, span_lint_and_then}; use crate::utils::{is_copy, match_type}; use rustc::hir::intravisit::{walk_path, NestedVisitorMap, Visitor}; -use rustc::hir::{self, *}; use rustc::lint::LateContext; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_hir::{self, *}; use rustc_span::source_map::Span; use rustc_span::symbol::Symbol; @@ -13,9 +13,9 @@ use super::OPTION_MAP_UNWRAP_OR; /// lint use of `map().unwrap_or()` for `Option`s pub(super) fn lint<'a, 'tcx>( cx: &LateContext<'a, 'tcx>, - expr: &hir::Expr<'_>, - map_args: &'tcx [hir::Expr<'_>], - unwrap_args: &'tcx [hir::Expr<'_>], + expr: &rustc_hir::Expr<'_>, + map_args: &'tcx [rustc_hir::Expr<'_>], + unwrap_args: &'tcx [rustc_hir::Expr<'_>], map_span: Span, ) { // lint if the caller of `map()` is an `Option` diff --git a/clippy_lints/src/methods/unnecessary_filter_map.rs b/clippy_lints/src/methods/unnecessary_filter_map.rs index 567b3db1e82c..b77a40c6fc03 100644 --- a/clippy_lints/src/methods/unnecessary_filter_map.rs +++ b/clippy_lints/src/methods/unnecessary_filter_map.rs @@ -1,10 +1,10 @@ use crate::utils::paths; use crate::utils::usage::mutated_variables; use crate::utils::{match_qpath, match_trait_method, span_lint}; -use rustc::hir; -use rustc::hir::def::Res; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use rustc::lint::LateContext; +use rustc_hir as hir; +use rustc_hir::def::Res; use if_chain::if_chain; diff --git a/clippy_lints/src/minmax.rs b/clippy_lints/src/minmax.rs index a838bb0f3d89..4e2948620e2d 100644 --- a/clippy_lints/src/minmax.rs +++ b/clippy_lints/src/minmax.rs @@ -1,8 +1,8 @@ use crate::consts::{constant_simple, Constant}; use crate::utils::{match_def_path, paths, span_lint}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use std::cmp::Ordering; diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 2dbf88c76bf4..202fb4cdcf7f 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -2,10 +2,10 @@ use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; use rustc::hir::intravisit::FnKind; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::{ExpnKind, Span}; use syntax::ast::LitKind; @@ -482,7 +482,7 @@ fn is_allowed<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) -> boo // Return true if `expr` is the result of `signum()` invoked on a float value. fn is_signum(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool { // The negation of a signum is still a signum - if let ExprKind::Unary(UnNeg, ref child_expr) = expr.kind { + if let ExprKind::Unary(UnOp::UnNeg, ref child_expr) = expr.kind { return is_signum(cx, &child_expr); } @@ -544,7 +544,7 @@ fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr<'_>, other: &Expr<'_>) { } let other_gets_derefed = match other.kind { - ExprKind::Unary(UnDeref, _) => true, + ExprKind::Unary(UnOp::UnDeref, _) => true, _ => false, }; diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index cddcba3cb010..980812c9e0ca 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -1,9 +1,9 @@ use crate::utils::{has_drop, is_entrypoint_fn, span_lint, trait_ref_of_method}; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit::FnKind; -use rustc::hir::{Body, Constness, FnDecl, HirId}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir as hir; +use rustc_hir::{Body, Constness, FnDecl, HirId}; use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn; use rustc_session::declare_tool_lint; use rustc_span::Span; diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 9972c922d516..e736e13deed8 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -7,10 +7,10 @@ use crate::utils::span_lint; use if_chain::if_chain; -use rustc::hir; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::{self, MetaItem, MetaItemKind}; diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index dab5bee3ffe7..1ad3dff531dc 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -1,7 +1,7 @@ use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{self, LateContext, LateLintPass, LintArray, LintContext, LintPass}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast; diff --git a/clippy_lints/src/modulo_arithmetic.rs b/clippy_lints/src/modulo_arithmetic.rs index 09c3ce8d0283..82631257da8b 100644 --- a/clippy_lints/src/modulo_arithmetic.rs +++ b/clippy_lints/src/modulo_arithmetic.rs @@ -2,9 +2,9 @@ use crate::consts::{constant, Constant}; use crate::utils::{sext, span_lint_and_then}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use std::fmt::Display; diff --git a/clippy_lints/src/mul_add.rs b/clippy_lints/src/mul_add.rs index d62cea7cdb29..1f4f0d53cccb 100644 --- a/clippy_lints/src/mul_add.rs +++ b/clippy_lints/src/mul_add.rs @@ -1,7 +1,7 @@ use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::*; diff --git a/clippy_lints/src/mut_key.rs b/clippy_lints/src/mut_key.rs index 92e2f353962f..367f8638dc78 100644 --- a/clippy_lints/src/mut_key.rs +++ b/clippy_lints/src/mut_key.rs @@ -1,8 +1,8 @@ use crate::utils::{match_def_path, paths, span_lint, trait_ref_of_method, walk_ptrs_ty}; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{Adt, Dynamic, Opaque, Param, RawPtr, Ref, Ty, TypeAndMut}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/mut_mut.rs b/clippy_lints/src/mut_mut.rs index 66cd61e2a6f1..c2e99c3559d8 100644 --- a/clippy_lints/src/mut_mut.rs +++ b/clippy_lints/src/mut_mut.rs @@ -1,9 +1,9 @@ use crate::utils::{higher, span_lint}; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty; +use rustc_hir as hir; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/mut_reference.rs b/clippy_lints/src/mut_reference.rs index 6e5c5102a4ce..165b3a7c7e68 100644 --- a/clippy_lints/src/mut_reference.rs +++ b/clippy_lints/src/mut_reference.rs @@ -1,9 +1,9 @@ use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::subst::Subst; use rustc::ty::{self, Ty}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs index 9a18bce9f2f4..bbcfcd436135 100644 --- a/clippy_lints/src/mutable_debug_assertion.rs +++ b/clippy_lints/src/mutable_debug_assertion.rs @@ -2,9 +2,9 @@ use crate::utils::{is_direct_expn_of, span_lint}; use if_chain::if_chain; use matches::matches; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::{declare_lint_pass, ty}; +use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp}; use rustc_session::declare_tool_lint; use rustc_span::Span; diff --git a/clippy_lints/src/mutex_atomic.rs b/clippy_lints/src/mutex_atomic.rs index 08c94be54ff2..fb3c767caca5 100644 --- a/clippy_lints/src/mutex_atomic.rs +++ b/clippy_lints/src/mutex_atomic.rs @@ -4,9 +4,9 @@ use crate::utils::{match_type, paths, span_lint}; use rustc::declare_lint_pass; -use rustc::hir::Expr; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; +use rustc_hir::Expr; use rustc_session::declare_tool_lint; use syntax::ast; diff --git a/clippy_lints/src/needless_bool.rs b/clippy_lints/src/needless_bool.rs index 0fe3301ae283..c11e6bf25f43 100644 --- a/clippy_lints/src/needless_bool.rs +++ b/clippy_lints/src/needless_bool.rs @@ -5,9 +5,9 @@ use crate::utils::sugg::Sugg; use crate::utils::{higher, parent_node_is_if_expr, span_lint, span_lint_and_sugg}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Spanned; use syntax::ast::LitKind; diff --git a/clippy_lints/src/needless_borrow.rs b/clippy_lints/src/needless_borrow.rs index a74b6dbf317c..985501472740 100644 --- a/clippy_lints/src/needless_borrow.rs +++ b/clippy_lints/src/needless_borrow.rs @@ -4,12 +4,12 @@ use crate::utils::{snippet_opt, span_lint_and_then}; use if_chain::if_chain; -use rustc::hir::{BindingAnnotation, BorrowKind, Expr, ExprKind, HirId, Item, Mutability, Pat, PatKind}; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc::ty::adjustment::{Adjust, Adjustment}; use rustc_errors::Applicability; +use rustc_hir::{BindingAnnotation, BorrowKind, Expr, ExprKind, HirId, Item, Mutability, Pat, PatKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_borrowed_ref.rs b/clippy_lints/src/needless_borrowed_ref.rs index bf7e44a1fcc3..f05b47cf926c 100644 --- a/clippy_lints/src/needless_borrowed_ref.rs +++ b/clippy_lints/src/needless_borrowed_ref.rs @@ -5,9 +5,9 @@ use crate::utils::{snippet_with_applicability, span_lint_and_then}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{BindingAnnotation, Mutability, Node, Pat, PatKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::{BindingAnnotation, Mutability, Node, Pat, PatKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 4be858be3772..c580715a1b21 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -7,12 +7,12 @@ use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; use rustc::hir::intravisit::FnKind; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::traits; use rustc::ty::{self, RegionKind, TypeFoldable}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::{Span, Symbol}; use rustc_target::spec::abi::Abi; diff --git a/clippy_lints/src/needless_update.rs b/clippy_lints/src/needless_update.rs index dfcba2904215..f122948893f5 100644 --- a/clippy_lints/src/needless_update.rs +++ b/clippy_lints/src/needless_update.rs @@ -1,8 +1,8 @@ use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs index 4e6bcc6f1d91..1a556fff23f4 100644 --- a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs +++ b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs @@ -1,7 +1,7 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::{self, paths, span_lint}; diff --git a/clippy_lints/src/neg_multiply.rs b/clippy_lints/src/neg_multiply.rs index 1be437805e34..9757d1c01b95 100644 --- a/clippy_lints/src/neg_multiply.rs +++ b/clippy_lints/src/neg_multiply.rs @@ -1,7 +1,7 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; @@ -33,8 +33,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NegMultiply { if BinOpKind::Mul == op.node { match (&left.kind, &right.kind) { (&ExprKind::Unary(..), &ExprKind::Unary(..)) => {}, - (&ExprKind::Unary(UnNeg, ref lit), _) => check_mul(cx, e.span, lit, right), - (_, &ExprKind::Unary(UnNeg, ref lit)) => check_mul(cx, e.span, lit, left), + (&ExprKind::Unary(UnOp::UnNeg, ref lit), _) => check_mul(cx, e.span, lit, right), + (_, &ExprKind::Unary(UnOp::UnNeg, ref lit)) => check_mul(cx, e.span, lit, left), _ => {}, } } diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index 34ff57fa2972..84aaa90428df 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -2,13 +2,13 @@ use crate::utils::paths; use crate::utils::sugg::DiagnosticBuilderExt; use crate::utils::{get_trait_def_id, implements_trait, return_ty, same_tys, span_lint_hir_and_then}; use if_chain::if_chain; -use rustc::hir; -use rustc::hir::def_id::DefId; -use rustc::hir::HirIdSet; use rustc::impl_lint_pass; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::def_id::DefId; +use rustc_hir::HirIdSet; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/no_effect.rs b/clippy_lints/src/no_effect.rs index afd0be851d8a..6a00d253c956 100644 --- a/clippy_lints/src/no_effect.rs +++ b/clippy_lints/src/no_effect.rs @@ -1,9 +1,9 @@ use crate::utils::{has_drop, qpath_res, snippet_opt, span_lint, span_lint_and_sugg}; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::{BinOpKind, BlockCheckMode, Expr, ExprKind, Stmt, StmtKind, UnsafeSource}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::{BinOpKind, BlockCheckMode, Expr, ExprKind, Stmt, StmtKind, UnsafeSource}; use rustc_session::declare_tool_lint; use std::ops::Deref; diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index e671f31ca6fb..039de766c086 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -5,11 +5,11 @@ use std::ptr; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass}; use rustc::ty::adjustment::Adjust; use rustc::ty::{Ty, TypeFlags}; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::{InnerSpan, Span, DUMMY_SP}; use rustc_typeck::hir_ty_to_ty; @@ -222,7 +222,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst { needs_check_adjustment = false; break; }, - ExprKind::Unary(UnDeref, _) => { + ExprKind::Unary(UnOp::UnDeref, _) => { // `*e` => desugared to `*Deref::deref(&e)`, // meaning `e` must be referenced. // no need to go further up since a method call is involved now. diff --git a/clippy_lints/src/ok_if_let.rs b/clippy_lints/src/ok_if_let.rs index 54fd13213173..083f0ee2168d 100644 --- a/clippy_lints/src/ok_if_let.rs +++ b/clippy_lints/src/ok_if_let.rs @@ -1,8 +1,8 @@ use crate::utils::{match_type, method_chain_args, paths, snippet, span_help_and_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/open_options.rs b/clippy_lints/src/open_options.rs index eeefa2ffcf59..7ae73edc0164 100644 --- a/clippy_lints/src/open_options.rs +++ b/clippy_lints/src/open_options.rs @@ -1,7 +1,7 @@ use crate::utils::{match_type, paths, span_lint, walk_ptrs_ty}; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; use rustc_span::source_map::{Span, Spanned}; use syntax::ast::LitKind; diff --git a/clippy_lints/src/overflow_check_conditional.rs b/clippy_lints/src/overflow_check_conditional.rs index 4c67539f62b3..453ebb1c6e19 100644 --- a/clippy_lints/src/overflow_check_conditional.rs +++ b/clippy_lints/src/overflow_check_conditional.rs @@ -1,8 +1,8 @@ use crate::utils::{span_lint, SpanlessEq}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index 007b49cbf907..8677be559183 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -1,8 +1,8 @@ use crate::utils::{is_direct_expn_of, is_expn_of, match_function_call, paths, span_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::Span; use syntax::ast::LitKind; diff --git a/clippy_lints/src/partialeq_ne_impl.rs b/clippy_lints/src/partialeq_ne_impl.rs index b84a8840d5ee..7522b96e1cde 100644 --- a/clippy_lints/src/partialeq_ne_impl.rs +++ b/clippy_lints/src/partialeq_ne_impl.rs @@ -1,8 +1,8 @@ use crate::utils::{is_automatically_derived, span_lint_hir}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/path_buf_push_overwrite.rs b/clippy_lints/src/path_buf_push_overwrite.rs index 2a9d31ec937e..2ae67d2e995f 100644 --- a/clippy_lints/src/path_buf_push_overwrite.rs +++ b/clippy_lints/src/path_buf_push_overwrite.rs @@ -1,9 +1,9 @@ use crate::utils::{match_type, paths, span_lint_and_sugg, walk_ptrs_ty}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use std::path::{Component, Path}; use syntax::ast::LitKind; diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index e1c54f6ed377..87a487c3b9eb 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -7,11 +7,11 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::QPath; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::QPath; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::{MultiSpan, Symbol}; diff --git a/clippy_lints/src/ptr_offset_with_cast.rs b/clippy_lints/src/ptr_offset_with_cast.rs index f7c42c356bee..129adbe5fed7 100644 --- a/clippy_lints/src/ptr_offset_with_cast.rs +++ b/clippy_lints/src/ptr_offset_with_cast.rs @@ -1,8 +1,8 @@ use crate::utils; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; use std::fmt; diff --git a/clippy_lints/src/question_mark.rs b/clippy_lints/src/question_mark.rs index cd06dad3a813..12d0197c3a00 100644 --- a/clippy_lints/src/question_mark.rs +++ b/clippy_lints/src/question_mark.rs @@ -1,9 +1,9 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use crate::utils::paths::*; diff --git a/clippy_lints/src/ranges.rs b/clippy_lints/src/ranges.rs index 5954ceab7219..7787aa326613 100644 --- a/clippy_lints/src/ranges.rs +++ b/clippy_lints/src/ranges.rs @@ -1,8 +1,8 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Spanned; use syntax::ast::RangeLimits; diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index 27f44024cd4b..12c99bc8f9bb 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -6,7 +6,6 @@ use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; use rustc::hir::intravisit::FnKind; -use rustc::hir::{def_id, Body, FnDecl, HirId}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::mir::{ self, traversal, @@ -15,6 +14,7 @@ use rustc::mir::{ use rustc::ty::{self, fold::TypeVisitor, Ty}; use rustc_data_structures::{fx::FxHashMap, transitive_relation::TransitiveRelation}; use rustc_errors::Applicability; +use rustc_hir::{def_id, Body, FnDecl, HirId}; use rustc_index::bit_set::{BitSet, HybridBitSet}; use rustc_mir::dataflow::{ do_dataflow, BitDenotation, BottomValue, DataflowResults, DataflowResultsCursor, DebugFormatted, GenKillSet, diff --git a/clippy_lints/src/redundant_pattern_matching.rs b/clippy_lints/src/redundant_pattern_matching.rs index fabaa29d7c5e..59e55e583983 100644 --- a/clippy_lints/src/redundant_pattern_matching.rs +++ b/clippy_lints/src/redundant_pattern_matching.rs @@ -1,8 +1,8 @@ use crate::utils::{match_qpath, paths, snippet, span_lint_and_then}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use syntax::ast::LitKind; diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index caca4f910e57..188ff6d205f7 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -1,10 +1,10 @@ use crate::consts::{constant, Constant}; use crate::utils::{is_expn_of, match_def_path, match_type, paths, span_help_and_lint, span_lint}; use if_chain::if_chain; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashSet; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::{BytePos, Span}; use std::convert::TryFrom; diff --git a/clippy_lints/src/replace_consts.rs b/clippy_lints/src/replace_consts.rs index a8259b0265a3..26ce494245cf 100644 --- a/clippy_lints/src/replace_consts.rs +++ b/clippy_lints/src/replace_consts.rs @@ -1,10 +1,10 @@ use crate::utils::{match_def_path, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/serde_api.rs b/clippy_lints/src/serde_api.rs index 15cf50f80212..68c3cc70d284 100644 --- a/clippy_lints/src/serde_api.rs +++ b/clippy_lints/src/serde_api.rs @@ -1,7 +1,7 @@ use crate::utils::{get_trait_def_id, paths, span_lint}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index a6673772bc45..6efb2c272f15 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -2,9 +2,9 @@ use crate::reexport::*; use crate::utils::{contains_name, higher, iter_input_pats, snippet, span_lint_and_then}; use rustc::declare_lint_pass; use rustc::hir::intravisit::FnKind; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; @@ -371,7 +371,7 @@ fn is_self_shadow(name: Name, expr: &Expr<'_>) -> bool { ExprKind::Block(ref block, _) => { block.stmts.is_empty() && block.expr.as_ref().map_or(false, |e| is_self_shadow(name, e)) }, - ExprKind::Unary(op, ref inner) => (UnDeref == op) && is_self_shadow(name, inner), + ExprKind::Unary(op, ref inner) => (UnOp::UnDeref == op) && is_self_shadow(name, inner), ExprKind::Path(QPath::Resolved(_, ref path)) => path_eq_name(name, path), _ => false, } diff --git a/clippy_lints/src/slow_vector_initialization.rs b/clippy_lints/src/slow_vector_initialization.rs index f9e4e75a22bd..65b88f51ce27 100644 --- a/clippy_lints/src/slow_vector_initialization.rs +++ b/clippy_lints/src/slow_vector_initialization.rs @@ -3,9 +3,9 @@ use crate::utils::{get_enclosing_block, match_qpath, span_lint_and_then, Spanles use if_chain::if_chain; use rustc::declare_lint_pass; use rustc::hir::intravisit::{walk_block, walk_expr, walk_stmt, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::symbol::Symbol; use syntax::ast::LitKind; diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index d09d7279c745..e36dbbbe5f42 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -1,7 +1,7 @@ use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Spanned; diff --git a/clippy_lints/src/suspicious_trait_impl.rs b/clippy_lints/src/suspicious_trait_impl.rs index 94ecb1459157..4756ca364d92 100644 --- a/clippy_lints/src/suspicious_trait_impl.rs +++ b/clippy_lints/src/suspicious_trait_impl.rs @@ -1,9 +1,9 @@ use crate::utils::{get_trait_def_id, span_lint, trait_ref_of_method}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/swap.rs b/clippy_lints/src/swap.rs index fb3d7ecafc2a..4b8fcbb63c50 100644 --- a/clippy_lints/src/swap.rs +++ b/clippy_lints/src/swap.rs @@ -6,10 +6,10 @@ use crate::utils::{ use if_chain::if_chain; use matches::matches; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::Symbol; diff --git a/clippy_lints/src/temporary_assignment.rs b/clippy_lints/src/temporary_assignment.rs index c7ae7b941144..b5419c80341e 100644 --- a/clippy_lints/src/temporary_assignment.rs +++ b/clippy_lints/src/temporary_assignment.rs @@ -1,9 +1,9 @@ use crate::utils::is_adjusted; use crate::utils::span_lint; use rustc::declare_lint_pass; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/to_digit_is_some.rs b/clippy_lints/src/to_digit_is_some.rs index ad8a4460953c..3d5f3347eda2 100644 --- a/clippy_lints/src/to_digit_is_some.rs +++ b/clippy_lints/src/to_digit_is_some.rs @@ -1,10 +1,10 @@ use crate::utils::{match_def_path, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/trait_bounds.rs b/clippy_lints/src/trait_bounds.rs index 70943894cd27..476517362a1e 100644 --- a/clippy_lints/src/trait_bounds.rs +++ b/clippy_lints/src/trait_bounds.rs @@ -1,8 +1,8 @@ use crate::utils::{in_macro, snippet, span_help_and_lint, SpanlessHash}; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashMap; +use rustc_hir::*; use rustc_session::declare_tool_lint; #[derive(Copy, Clone)] diff --git a/clippy_lints/src/transmute.rs b/clippy_lints/src/transmute.rs index b6ae611da12b..7e87a285eba9 100644 --- a/clippy_lints/src/transmute.rs +++ b/clippy_lints/src/transmute.rs @@ -3,10 +3,10 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use std::borrow::Cow; use syntax::ast; diff --git a/clippy_lints/src/transmuting_null.rs b/clippy_lints/src/transmuting_null.rs index 6438c79f99e8..3ecd45b580db 100644 --- a/clippy_lints/src/transmuting_null.rs +++ b/clippy_lints/src/transmuting_null.rs @@ -2,8 +2,8 @@ use crate::consts::{constant_context, Constant}; use crate::utils::{match_qpath, paths, span_lint}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::{Expr, ExprKind}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; +use rustc_hir::{Expr, ExprKind}; use rustc_session::declare_tool_lint; use syntax::ast::LitKind; diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs index 04f9c47fa77a..f28527dc71fb 100644 --- a/clippy_lints/src/trivially_copy_pass_by_ref.rs +++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs @@ -3,14 +3,14 @@ use std::cmp; use crate::utils::{is_copy, is_self_ty, snippet, span_lint_and_sugg}; use if_chain::if_chain; use matches::matches; -use rustc::hir; use rustc::hir::intravisit::FnKind; -use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::session::config::Config as SessionConfig; use rustc::ty; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::Span; use rustc_target::abi::LayoutOf; diff --git a/clippy_lints/src/try_err.rs b/clippy_lints/src/try_err.rs index ef3c4b546c62..76c1decc611a 100644 --- a/clippy_lints/src/try_err.rs +++ b/clippy_lints/src/try_err.rs @@ -1,10 +1,10 @@ use crate::utils::{match_qpath, paths, snippet, snippet_with_macro_callsite, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::Ty; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 1a14d81299cf..7d49b31d99f5 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -5,14 +5,14 @@ use std::cmp::Ordering; use std::collections::BTreeMap; use if_chain::if_chain; -use rustc::hir; use rustc::hir::intravisit::{walk_body, walk_expr, walk_ty, FnKind, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::layout::LayoutOf; use rustc::ty::{self, InferTy, Ty, TyCtxt, TypeckTables}; use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::source_map::Span; @@ -1452,7 +1452,7 @@ impl<'a, 'tcx> TypeComplexity { for arg in decl.inputs { self.check_type(cx, arg); } - if let Return(ref ty) = decl.output { + if let FunctionRetTy::Return(ref ty) = decl.output { self.check_type(cx, ty); } } diff --git a/clippy_lints/src/unicode.rs b/clippy_lints/src/unicode.rs index 8b4d282130c8..ebef3c0faa81 100644 --- a/clippy_lints/src/unicode.rs +++ b/clippy_lints/src/unicode.rs @@ -1,8 +1,8 @@ use crate::utils::{is_allowed, snippet, span_lint_and_sugg}; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use syntax::ast::LitKind; diff --git a/clippy_lints/src/unused_io_amount.rs b/clippy_lints/src/unused_io_amount.rs index db1e61b4edd8..b51e13c39150 100644 --- a/clippy_lints/src/unused_io_amount.rs +++ b/clippy_lints/src/unused_io_amount.rs @@ -1,7 +1,7 @@ use crate::utils::{is_try, match_qpath, match_trait_method, paths, span_lint}; use rustc::declare_lint_pass; -use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir as hir; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/clippy_lints/src/unused_self.rs b/clippy_lints/src/unused_self.rs index ec9362fe35cb..b698a4a22878 100644 --- a/clippy_lints/src/unused_self.rs +++ b/clippy_lints/src/unused_self.rs @@ -1,9 +1,9 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::def::Res; use rustc::hir::intravisit::{walk_path, NestedVisitorMap, Visitor}; -use rustc::hir::{AssocItemKind, HirId, ImplItemKind, ImplItemRef, Item, ItemKind, Path}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::def::Res; +use rustc_hir::{AssocItemKind, HirId, ImplItemKind, ImplItemRef, Item, ItemKind, Path}; use rustc_session::declare_tool_lint; use crate::utils::span_help_and_lint; diff --git a/clippy_lints/src/unwrap.rs b/clippy_lints/src/unwrap.rs index 1a0ac91e17f9..e9b4b1a5051a 100644 --- a/clippy_lints/src/unwrap.rs +++ b/clippy_lints/src/unwrap.rs @@ -5,7 +5,7 @@ use rustc_session::declare_tool_lint; use crate::utils::{higher::if_block, match_type, paths, span_lint_and_then, usage::is_potentially_mutated}; use rustc::hir::intravisit::*; -use rustc::hir::*; +use rustc_hir::*; use rustc_span::source_map::Span; declare_clippy_lint! { @@ -93,7 +93,7 @@ fn collect_unwrap_info<'a, 'tcx>( }, _ => (), } - } else if let ExprKind::Unary(UnNot, expr) = &expr.kind { + } else if let ExprKind::Unary(UnOp::UnNot, expr) = &expr.kind { return collect_unwrap_info(cx, expr, !invert); } else { if_chain! { diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 4f3b2c188ea7..d4addec306a5 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -1,13 +1,13 @@ use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir; -use rustc::hir::def::{DefKind, Res}; use rustc::hir::intravisit::{walk_item, walk_path, walk_ty, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty; use rustc::ty::{DefIdTree, Ty}; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::symbol::kw; diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index 27ab2fb675aa..173f3b84eed5 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -3,12 +3,12 @@ use crate::utils::{get_attr, higher}; use rustc::declare_lint_pass; -use rustc::hir; use rustc::hir::intravisit::{NestedVisitorMap, Visitor}; -use rustc::hir::{BindingAnnotation, Block, Expr, ExprKind, Pat, PatKind, QPath, Stmt, StmtKind, TyKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::session::Session; use rustc_data_structures::fx::FxHashMap; +use rustc_hir as hir; +use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, Pat, PatKind, QPath, Stmt, StmtKind, TyKind}; use rustc_session::declare_tool_lint; use syntax::ast::{Attribute, LitFloatType, LitKind}; diff --git a/clippy_lints/src/utils/comparisons.rs b/clippy_lints/src/utils/comparisons.rs index 33c6bcc66d03..7a18d5e818fb 100644 --- a/clippy_lints/src/utils/comparisons.rs +++ b/clippy_lints/src/utils/comparisons.rs @@ -2,7 +2,7 @@ #![deny(clippy::missing_docs_in_private_items)] -use rustc::hir::{BinOpKind, Expr}; +use rustc_hir::{BinOpKind, Expr}; #[derive(PartialEq, Eq, Debug, Copy, Clone)] /// Represent a normalized comparison operator. diff --git a/clippy_lints/src/utils/diagnostics.rs b/clippy_lints/src/utils/diagnostics.rs index 19992114ff7c..629dc0950dc3 100644 --- a/clippy_lints/src/utils/diagnostics.rs +++ b/clippy_lints/src/utils/diagnostics.rs @@ -1,8 +1,8 @@ //! Clippy wrappers around rustc's diagnostic functions. -use rustc::hir::HirId; use rustc::lint::{LateContext, Lint, LintContext}; use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart, SuggestionStyle}; +use rustc_hir::HirId; use rustc_span::source_map::{MultiSpan, Span}; use std::env; use syntax::errors::DiagnosticBuilder; diff --git a/clippy_lints/src/utils/higher.rs b/clippy_lints/src/utils/higher.rs index 37d37a94d0e8..804ba8ae88d9 100644 --- a/clippy_lints/src/utils/higher.rs +++ b/clippy_lints/src/utils/higher.rs @@ -6,7 +6,8 @@ use crate::utils::{is_expn_of, match_def_path, match_qpath, paths}; use if_chain::if_chain; use rustc::lint::LateContext; -use rustc::{hir, ty}; +use rustc::ty; +use rustc_hir as hir; use syntax::ast; /// Converts a hir binary operator to the corresponding `ast` type. diff --git a/clippy_lints/src/utils/hir_utils.rs b/clippy_lints/src/utils/hir_utils.rs index 824c062843e6..13ea90cff59b 100644 --- a/clippy_lints/src/utils/hir_utils.rs +++ b/clippy_lints/src/utils/hir_utils.rs @@ -1,10 +1,10 @@ use crate::consts::{constant_context, constant_simple}; use crate::utils::differing_macro_contexts; -use rustc::hir::*; use rustc::ich::StableHashingContextProvider; use rustc::lint::LateContext; use rustc::ty::TypeckTables; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; +use rustc_hir::*; use std::hash::Hash; use syntax::ast::Name; diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 87ef4c7799e9..38bf6ee52396 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -2,10 +2,10 @@ use crate::utils::get_attr; use rustc::declare_lint_pass; -use rustc::hir; -use rustc::hir::print; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::session::Session; +use rustc_hir as hir; +use rustc_hir::print; use rustc_session::declare_tool_lint; use syntax::ast::Attribute; diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index b7eb1ae7c9d7..58552d08b324 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -3,14 +3,14 @@ use crate::utils::{ walk_ptrs_ty, }; use if_chain::if_chain; -use rustc::hir; -use rustc::hir::def::{DefKind, Res}; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray, LintPass}; use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; use rustc_span::symbol::SymbolStr; diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index e83dc249d268..3c806cc7ea58 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -25,12 +25,7 @@ use std::mem; use if_chain::if_chain; use matches::matches; -use rustc::hir; -use rustc::hir::def::{DefKind, Res}; -use rustc::hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc::hir::intravisit::{NestedVisitorMap, Visitor}; -use rustc::hir::Node; -use rustc::hir::*; use rustc::lint::{LateContext, Level, Lint, LintContext}; use rustc::traits; use rustc::ty::{ @@ -40,6 +35,11 @@ use rustc::ty::{ Binder, Ty, TyCtxt, }; use rustc_errors::Applicability; +use rustc_hir as hir; +use rustc_hir::def::{DefKind, Res}; +use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; +use rustc_hir::Node; +use rustc_hir::*; use rustc_span::hygiene::ExpnKind; use rustc_span::source_map::{Span, DUMMY_SP}; use rustc_span::symbol::{kw, Symbol}; @@ -179,8 +179,8 @@ pub fn single_segment_path<'tcx>(path: &QPath<'tcx>) -> Option<&'tcx PathSegment /// Matches a `QPath` against a slice of segment string literals. /// -/// There is also `match_path` if you are dealing with a `rustc::hir::Path` instead of a -/// `rustc::hir::QPath`. +/// There is also `match_path` if you are dealing with a `rustc_hir::Path` instead of a +/// `rustc_hir::QPath`. /// /// # Examples /// ```rust,ignore @@ -202,8 +202,8 @@ pub fn match_qpath(path: &QPath<'_>, segments: &[&str]) -> bool { /// Matches a `Path` against a slice of segment string literals. /// -/// There is also `match_qpath` if you are dealing with a `rustc::hir::QPath` instead of a -/// `rustc::hir::Path`. +/// There is also `match_qpath` if you are dealing with a `rustc_hir::QPath` instead of a +/// `rustc_hir::Path`. /// /// # Examples /// diff --git a/clippy_lints/src/utils/ptr.rs b/clippy_lints/src/utils/ptr.rs index de6a3227a77d..e32d5e3a4ed0 100644 --- a/clippy_lints/src/utils/ptr.rs +++ b/clippy_lints/src/utils/ptr.rs @@ -1,7 +1,7 @@ use crate::utils::{get_pat_name, match_var, snippet}; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; -use rustc::hir::*; use rustc::lint::LateContext; +use rustc_hir::*; use rustc_span::source_map::Span; use std::borrow::Cow; use syntax::ast::Name; diff --git a/clippy_lints/src/utils/sugg.rs b/clippy_lints/src/utils/sugg.rs index 0106217186be..f14390ce3af6 100644 --- a/clippy_lints/src/utils/sugg.rs +++ b/clippy_lints/src/utils/sugg.rs @@ -3,9 +3,9 @@ use crate::utils::{higher, snippet, snippet_opt, snippet_with_macro_callsite}; use matches::matches; -use rustc::hir; use rustc::lint::{EarlyContext, LateContext, LintContext}; use rustc_errors::Applicability; +use rustc_hir as hir; use rustc_span::source_map::{CharPos, Span}; use rustc_span::{BytePos, Pos}; use std::borrow::Cow; diff --git a/clippy_lints/src/utils/usage.rs b/clippy_lints/src/utils/usage.rs index d60ab7e7265a..623a12fbdaff 100644 --- a/clippy_lints/src/utils/usage.rs +++ b/clippy_lints/src/utils/usage.rs @@ -1,8 +1,8 @@ -use rustc::hir::def::Res; -use rustc::hir::*; use rustc::lint::LateContext; use rustc::ty; use rustc_data_structures::fx::FxHashSet; +use rustc_hir::def::Res; +use rustc_hir::*; use rustc_typeck::expr_use_visitor::*; /// Returns a set of mutated local variable IDs, or `None` if mutations could not be determined. diff --git a/clippy_lints/src/vec.rs b/clippy_lints/src/vec.rs index ebde35bb0571..c5951dc1e78d 100644 --- a/clippy_lints/src/vec.rs +++ b/clippy_lints/src/vec.rs @@ -2,10 +2,10 @@ use crate::consts::constant; use crate::utils::{higher, is_copy, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; use rustc_errors::Applicability; +use rustc_hir::*; use rustc_session::declare_tool_lint; use rustc_span::source_map::Span; diff --git a/clippy_lints/src/zero_div_zero.rs b/clippy_lints/src/zero_div_zero.rs index 06d4aa00f6b0..fc46da2c720b 100644 --- a/clippy_lints/src/zero_div_zero.rs +++ b/clippy_lints/src/zero_div_zero.rs @@ -2,8 +2,8 @@ use crate::consts::{constant_simple, Constant}; use crate::utils::span_help_and_lint; use if_chain::if_chain; use rustc::declare_lint_pass; -use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::*; use rustc_session::declare_tool_lint; declare_clippy_lint! { diff --git a/tests/ui/outer_expn_data.fixed b/tests/ui/outer_expn_data.fixed index 77c3f93b7c98..4a3fa0341391 100644 --- a/tests/ui/outer_expn_data.fixed +++ b/tests/ui/outer_expn_data.fixed @@ -6,8 +6,10 @@ #[macro_use] extern crate rustc; #[macro_use] +extern crate rustc_hir; +#[macro_use] extern crate rustc_session; -use rustc::hir::Expr; +use rustc_hir::Expr; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; declare_lint! { diff --git a/tests/ui/outer_expn_data.rs b/tests/ui/outer_expn_data.rs index b45f5e1ac406..c8ff4806d123 100644 --- a/tests/ui/outer_expn_data.rs +++ b/tests/ui/outer_expn_data.rs @@ -6,9 +6,11 @@ #[macro_use] extern crate rustc; #[macro_use] +extern crate rustc_hir; +#[macro_use] extern crate rustc_session; -use rustc::hir::Expr; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; +use rustc_hir::Expr; declare_lint! { pub TEST_LINT, diff --git a/tests/ui/outer_expn_data.stderr b/tests/ui/outer_expn_data.stderr index 514eb599b061..4a8e7353d1cf 100644 --- a/tests/ui/outer_expn_data.stderr +++ b/tests/ui/outer_expn_data.stderr @@ -1,5 +1,5 @@ error: usage of `outer_expn().expn_data()` - --> $DIR/outer_expn_data.rs:23:34 + --> $DIR/outer_expn_data.rs:25:34 | LL | let _ = expr.span.ctxt().outer_expn().expn_data(); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `outer_expn_data()`