From 98e433d70d32086afb80bd4c20fe769a1c0a38ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 4 Dec 2019 00:16:03 +0100 Subject: [PATCH] Rustup to rust-lang/rust#66878 --- clippy_lints/src/approx_const.rs | 3 ++- clippy_lints/src/arithmetic.rs | 3 ++- clippy_lints/src/as_conversions.rs | 3 ++- clippy_lints/src/assertions_on_constants.rs | 3 ++- clippy_lints/src/assign_ops.rs | 3 ++- clippy_lints/src/attrs.rs | 3 ++- clippy_lints/src/bit_mask.rs | 3 ++- clippy_lints/src/blacklisted_name.rs | 3 ++- clippy_lints/src/block_in_if_condition.rs | 3 ++- clippy_lints/src/booleans.rs | 3 ++- clippy_lints/src/bytecount.rs | 3 ++- clippy_lints/src/cargo_common_metadata.rs | 3 ++- clippy_lints/src/checked_conversions.rs | 3 ++- clippy_lints/src/cognitive_complexity.rs | 3 ++- clippy_lints/src/collapsible_if.rs | 3 ++- clippy_lints/src/comparison_chain.rs | 3 ++- clippy_lints/src/copies.rs | 3 ++- clippy_lints/src/copy_iterator.rs | 3 ++- clippy_lints/src/dbg_macro.rs | 3 ++- clippy_lints/src/default_trait_access.rs | 3 ++- clippy_lints/src/derive.rs | 3 ++- clippy_lints/src/doc.rs | 3 ++- clippy_lints/src/double_comparison.rs | 3 ++- clippy_lints/src/double_parens.rs | 3 ++- clippy_lints/src/drop_bounds.rs | 3 ++- clippy_lints/src/drop_forget_ref.rs | 3 ++- clippy_lints/src/duration_subsec.rs | 3 ++- clippy_lints/src/else_if_without_else.rs | 3 ++- clippy_lints/src/empty_enum.rs | 3 ++- clippy_lints/src/entry.rs | 3 ++- clippy_lints/src/enum_clike.rs | 3 ++- clippy_lints/src/enum_glob_use.rs | 3 ++- clippy_lints/src/enum_variants.rs | 3 ++- clippy_lints/src/eq_op.rs | 3 ++- clippy_lints/src/erasing_op.rs | 3 ++- clippy_lints/src/escape.rs | 3 ++- clippy_lints/src/eta_reduction.rs | 3 ++- clippy_lints/src/eval_order_dependence.rs | 3 ++- clippy_lints/src/excessive_precision.rs | 3 ++- clippy_lints/src/exit.rs | 3 ++- clippy_lints/src/explicit_write.rs | 3 ++- clippy_lints/src/fallible_impl_from.rs | 3 ++- clippy_lints/src/format.rs | 3 ++- clippy_lints/src/formatting.rs | 3 ++- clippy_lints/src/functions.rs | 3 ++- clippy_lints/src/get_last_with_len.rs | 3 ++- clippy_lints/src/identity_conversion.rs | 3 ++- clippy_lints/src/identity_op.rs | 3 ++- clippy_lints/src/if_not_else.rs | 3 ++- clippy_lints/src/implicit_return.rs | 3 ++- clippy_lints/src/indexing_slicing.rs | 3 ++- clippy_lints/src/infallible_destructuring_match.rs | 3 ++- clippy_lints/src/infinite_iter.rs | 3 ++- clippy_lints/src/inherent_impl.rs | 3 ++- clippy_lints/src/inherent_to_string.rs | 3 ++- clippy_lints/src/inline_fn_without_body.rs | 3 ++- clippy_lints/src/int_plus_one.rs | 3 ++- clippy_lints/src/integer_division.rs | 3 ++- clippy_lints/src/items_after_statements.rs | 3 ++- clippy_lints/src/large_enum_variant.rs | 3 ++- clippy_lints/src/large_stack_arrays.rs | 3 ++- clippy_lints/src/len_zero.rs | 3 ++- clippy_lints/src/let_if_seq.rs | 3 ++- clippy_lints/src/lib.rs | 6 +++++- clippy_lints/src/lifetimes.rs | 3 ++- clippy_lints/src/literal_representation.rs | 3 ++- clippy_lints/src/loops.rs | 3 ++- clippy_lints/src/main_recursion.rs | 3 ++- clippy_lints/src/map_clone.rs | 3 ++- clippy_lints/src/map_unit_fn.rs | 3 ++- clippy_lints/src/matches.rs | 3 ++- clippy_lints/src/mem_discriminant.rs | 3 ++- clippy_lints/src/mem_forget.rs | 3 ++- clippy_lints/src/mem_replace.rs | 3 ++- clippy_lints/src/methods/mod.rs | 3 ++- clippy_lints/src/minmax.rs | 3 ++- clippy_lints/src/misc.rs | 3 ++- clippy_lints/src/misc_early.rs | 3 ++- clippy_lints/src/missing_const_for_fn.rs | 3 ++- clippy_lints/src/missing_doc.rs | 3 ++- clippy_lints/src/missing_inline.rs | 3 ++- clippy_lints/src/mul_add.rs | 3 ++- clippy_lints/src/multiple_crate_versions.rs | 3 ++- clippy_lints/src/mut_mut.rs | 3 ++- clippy_lints/src/mut_reference.rs | 3 ++- clippy_lints/src/mutable_debug_assertion.rs | 3 ++- clippy_lints/src/mutex_atomic.rs | 3 ++- clippy_lints/src/needless_bool.rs | 3 ++- clippy_lints/src/needless_borrow.rs | 3 ++- clippy_lints/src/needless_borrowed_ref.rs | 3 ++- clippy_lints/src/needless_continue.rs | 3 ++- clippy_lints/src/needless_pass_by_value.rs | 3 ++- clippy_lints/src/needless_update.rs | 3 ++- clippy_lints/src/neg_cmp_op_on_partial_ord.rs | 3 ++- clippy_lints/src/neg_multiply.rs | 3 ++- clippy_lints/src/new_without_default.rs | 3 ++- clippy_lints/src/no_effect.rs | 3 ++- clippy_lints/src/non_copy_const.rs | 3 ++- clippy_lints/src/non_expressive_names.rs | 3 ++- clippy_lints/src/ok_if_let.rs | 3 ++- clippy_lints/src/open_options.rs | 3 ++- clippy_lints/src/overflow_check_conditional.rs | 3 ++- clippy_lints/src/panic_unimplemented.rs | 3 ++- clippy_lints/src/partialeq_ne_impl.rs | 3 ++- clippy_lints/src/path_buf_push_overwrite.rs | 3 ++- clippy_lints/src/precedence.rs | 3 ++- clippy_lints/src/ptr.rs | 3 ++- clippy_lints/src/ptr_offset_with_cast.rs | 3 ++- clippy_lints/src/question_mark.rs | 3 ++- clippy_lints/src/ranges.rs | 3 ++- clippy_lints/src/redundant_clone.rs | 3 ++- clippy_lints/src/redundant_field_names.rs | 3 ++- clippy_lints/src/redundant_pattern_matching.rs | 3 ++- clippy_lints/src/redundant_static_lifetimes.rs | 3 ++- clippy_lints/src/reference.rs | 3 ++- clippy_lints/src/regex.rs | 3 ++- clippy_lints/src/replace_consts.rs | 3 ++- clippy_lints/src/returns.rs | 3 ++- clippy_lints/src/serde_api.rs | 3 ++- clippy_lints/src/shadow.rs | 3 ++- clippy_lints/src/slow_vector_initialization.rs | 3 ++- clippy_lints/src/strings.rs | 3 ++- clippy_lints/src/suspicious_trait_impl.rs | 3 ++- clippy_lints/src/swap.rs | 3 ++- clippy_lints/src/tabs_in_doc_comments.rs | 3 ++- clippy_lints/src/temporary_assignment.rs | 3 ++- clippy_lints/src/to_digit_is_some.rs | 3 ++- clippy_lints/src/trait_bounds.rs | 3 ++- clippy_lints/src/transmute.rs | 3 ++- clippy_lints/src/transmuting_null.rs | 3 ++- clippy_lints/src/trivially_copy_pass_by_ref.rs | 3 ++- clippy_lints/src/try_err.rs | 3 ++- clippy_lints/src/types.rs | 3 ++- clippy_lints/src/unicode.rs | 3 ++- clippy_lints/src/unsafe_removed_from_name.rs | 3 ++- clippy_lints/src/unused_io_amount.rs | 3 ++- clippy_lints/src/unused_label.rs | 3 ++- clippy_lints/src/unused_self.rs | 3 ++- clippy_lints/src/unwrap.rs | 3 ++- clippy_lints/src/use_self.rs | 3 ++- clippy_lints/src/utils/author.rs | 3 ++- clippy_lints/src/utils/inspector.rs | 3 ++- clippy_lints/src/utils/internal_lints.rs | 3 ++- clippy_lints/src/utils/paths.rs | 2 +- clippy_lints/src/vec.rs | 3 ++- clippy_lints/src/wildcard_dependencies.rs | 3 ++- clippy_lints/src/write.rs | 3 ++- clippy_lints/src/zero_div_zero.rs | 3 ++- doc/adding_lints.md | 3 ++- tests/ui/lint_without_lint_pass.rs | 2 ++ tests/ui/lint_without_lint_pass.stderr | 2 +- tests/ui/outer_expn_data.fixed | 2 ++ tests/ui/outer_expn_data.rs | 2 ++ tests/ui/outer_expn_data.stderr | 2 +- 154 files changed, 308 insertions(+), 151 deletions(-) diff --git a/clippy_lints/src/approx_const.rs b/clippy_lints/src/approx_const.rs index 9f665a336..a35f7b450 100644 --- a/clippy_lints/src/approx_const.rs +++ b/clippy_lints/src/approx_const.rs @@ -1,7 +1,8 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use std::f64::consts as f64; use syntax::ast::{FloatTy, LitFloatType, LitKind}; use syntax::symbol; diff --git a/clippy_lints/src/arithmetic.rs b/clippy_lints/src/arithmetic.rs index 2c46bf2dc..d4402469a 100644 --- a/clippy_lints/src/arithmetic.rs +++ b/clippy_lints/src/arithmetic.rs @@ -1,8 +1,9 @@ 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::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/as_conversions.rs b/clippy_lints/src/as_conversions.rs index ee6357359..c2e387122 100644 --- a/clippy_lints/src/as_conversions.rs +++ b/clippy_lints/src/as_conversions.rs @@ -1,5 +1,6 @@ +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; use crate::utils::span_help_and_lint; diff --git a/clippy_lints/src/assertions_on_constants.rs b/clippy_lints/src/assertions_on_constants.rs index 853c31006..874fff1f0 100644 --- a/clippy_lints/src/assertions_on_constants.rs +++ b/clippy_lints/src/assertions_on_constants.rs @@ -2,9 +2,10 @@ use crate::consts::{constant, Constant}; 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; declare_clippy_lint! { diff --git a/clippy_lints/src/assign_ops.rs b/clippy_lints/src/assign_ops.rs index 3d12bb347..29dcffc32 100644 --- a/clippy_lints/src/assign_ops.rs +++ b/clippy_lints/src/assign_ops.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use crate::utils::{ get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, trait_ref_of_method, SpanlessEq, diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index 487ebb454..5f500fff1 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -6,14 +6,15 @@ use crate::utils::{ span_lint_and_then, without_block_comments, }; 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use semver::Version; use syntax::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem}; use syntax::source_map::Span; diff --git a/clippy_lints/src/bit_mask.rs b/clippy_lints/src/bit_mask.rs index 6d68c319f..e75220908 100644 --- a/clippy_lints/src/bit_mask.rs +++ b/clippy_lints/src/bit_mask.rs @@ -3,9 +3,10 @@ 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::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Span; diff --git a/clippy_lints/src/blacklisted_name.rs b/clippy_lints/src/blacklisted_name.rs index 986de32dd..d7dafa2a7 100644 --- a/clippy_lints/src/blacklisted_name.rs +++ b/clippy_lints/src/blacklisted_name.rs @@ -1,8 +1,9 @@ use crate::utils::span_lint; use rustc::hir::*; +use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashSet; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for usage of blacklisted names for variables, such diff --git a/clippy_lints/src/block_in_if_condition.rs b/clippy_lints/src/block_in_if_condition.rs index 4fa7048cd..1f2158ba0 100644 --- a/clippy_lints/src/block_in_if_condition.rs +++ b/clippy_lints/src/block_in_if_condition.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for `if` conditions that use blocks to contain an diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs index aaddbdcae..9518bee32 100644 --- a/clippy_lints/src/booleans.rs +++ b/clippy_lints/src/booleans.rs @@ -3,11 +3,12 @@ use crate::utils::{ span_lint_and_then, SpanlessEq, }; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::intravisit::*; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Span; diff --git a/clippy_lints/src/bytecount.rs b/clippy_lints/src/bytecount.rs index f53f5f3e9..4c0a4bdca 100644 --- a/clippy_lints/src/bytecount.rs +++ b/clippy_lints/src/bytecount.rs @@ -3,11 +3,12 @@ use crate::utils::{ 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::ty; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::{Name, UintTy}; declare_clippy_lint! { diff --git a/clippy_lints/src/cargo_common_metadata.rs b/clippy_lints/src/cargo_common_metadata.rs index 008e457ce..4fc9c3e60 100644 --- a/clippy_lints/src/cargo_common_metadata.rs +++ b/clippy_lints/src/cargo_common_metadata.rs @@ -3,8 +3,9 @@ use std::path::PathBuf; use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::{ast::*, source_map::DUMMY_SP}; use cargo_metadata; diff --git a/clippy_lints/src/checked_conversions.rs b/clippy_lints/src/checked_conversions.rs index dfd497f90..abd44974f 100644 --- a/clippy_lints/src/checked_conversions.rs +++ b/clippy_lints/src/checked_conversions.rs @@ -1,10 +1,11 @@ //! lint on manually implemented checked conversions that could be transformed into `try_from` 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq}; diff --git a/clippy_lints/src/cognitive_complexity.rs b/clippy_lints/src/cognitive_complexity.rs index 370421190..9f2e939b0 100644 --- a/clippy_lints/src/cognitive_complexity.rs +++ b/clippy_lints/src/cognitive_complexity.rs @@ -2,8 +2,9 @@ use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use rustc::hir::*; +use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use syntax::ast::Attribute; use syntax::source_map::Span; diff --git a/clippy_lints/src/collapsible_if.rs b/clippy_lints/src/collapsible_if.rs index 6a9d6d046..0fd0abdc3 100644 --- a/clippy_lints/src/collapsible_if.rs +++ b/clippy_lints/src/collapsible_if.rs @@ -13,8 +13,9 @@ //! This lint is **warn** by default use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast; use crate::utils::sugg::Sugg; diff --git a/clippy_lints/src/comparison_chain.rs b/clippy_lints/src/comparison_chain.rs index 087bceaff..9cbd30542 100644 --- a/clippy_lints/src/comparison_chain.rs +++ b/clippy_lints/src/comparison_chain.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks comparison chains written with `if` that can be diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index 9cbff066f..0c352e5a6 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::FxHashMap; +use rustc_session::declare_tool_lint; use std::collections::hash_map::Entry; use std::hash::BuildHasherDefault; use syntax::symbol::Symbol; diff --git a/clippy_lints/src/copy_iterator.rs b/clippy_lints/src/copy_iterator.rs index 73de8add3..274cf3b41 100644 --- a/clippy_lints/src/copy_iterator.rs +++ b/clippy_lints/src/copy_iterator.rs @@ -1,7 +1,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for types that implement `Copy` as well as diff --git a/clippy_lints/src/dbg_macro.rs b/clippy_lints/src/dbg_macro.rs index 0b42e02bb..48fc601e7 100644 --- a/clippy_lints/src/dbg_macro.rs +++ b/clippy_lints/src/dbg_macro.rs @@ -1,7 +1,8 @@ use crate::utils::{snippet_opt, span_help_and_lint, span_lint_and_sugg}; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast; use syntax::source_map::Span; use syntax::tokenstream::TokenStream; diff --git a/clippy_lints/src/default_trait_access.rs b/clippy_lints/src/default_trait_access.rs index 350e6c677..3fa2ede84 100644 --- a/clippy_lints/src/default_trait_access.rs +++ b/clippy_lints/src/default_trait_access.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +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 f60ed90cd..0852580e1 100644 --- a/clippy_lints/src/derive.rs +++ b/clippy_lints/src/derive.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index a8858a24e..0fcc9763d 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -2,9 +2,10 @@ use crate::utils::span_lint; use itertools::Itertools; use pulldown_cmark; use rustc::hir; +use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashSet; +use rustc_session::declare_tool_lint; use std::ops::Range; use syntax::ast::{AttrKind, Attribute}; use syntax::source_map::{BytePos, Span}; diff --git a/clippy_lints/src/double_comparison.rs b/clippy_lints/src/double_comparison.rs index a1e4be260..e7abc3c91 100644 --- a/clippy_lints/src/double_comparison.rs +++ b/clippy_lints/src/double_comparison.rs @@ -1,9 +1,10 @@ //! Lint on unnecessary double comparisons. Some examples: +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq}; diff --git a/clippy_lints/src/double_parens.rs b/clippy_lints/src/double_parens.rs index 3bdebbeae..52a5e2a1a 100644 --- a/clippy_lints/src/double_parens.rs +++ b/clippy_lints/src/double_parens.rs @@ -1,6 +1,7 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; declare_clippy_lint! { diff --git a/clippy_lints/src/drop_bounds.rs b/clippy_lints/src/drop_bounds.rs index e48de3f64..50a2a2c8b 100644 --- a/clippy_lints/src/drop_bounds.rs +++ b/clippy_lints/src/drop_bounds.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for generics with `std::ops::Drop` as bounds. diff --git a/clippy_lints/src/drop_forget_ref.rs b/clippy_lints/src/drop_forget_ref.rs index 13a2be6b3..7b049ed5d 100644 --- a/clippy_lints/src/drop_forget_ref.rs +++ b/clippy_lints/src/drop_forget_ref.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for calls to `std::mem::drop` with a reference diff --git a/clippy_lints/src/duration_subsec.rs b/clippy_lints/src/duration_subsec.rs index 119328cba..d5661e622 100644 --- a/clippy_lints/src/duration_subsec.rs +++ b/clippy_lints/src/duration_subsec.rs @@ -1,8 +1,9 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Spanned; use crate::consts::{constant, Constant}; diff --git a/clippy_lints/src/else_if_without_else.rs b/clippy_lints/src/else_if_without_else.rs index e6d7fe484..9e8ab0b29 100644 --- a/clippy_lints/src/else_if_without_else.rs +++ b/clippy_lints/src/else_if_without_else.rs @@ -1,7 +1,8 @@ //! Lint on if expressions with an else if, but without a final else branch. +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; use crate::utils::span_help_and_lint; diff --git a/clippy_lints/src/empty_enum.rs b/clippy_lints/src/empty_enum.rs index cfb908cf3..1d7f18bef 100644 --- a/clippy_lints/src/empty_enum.rs +++ b/clippy_lints/src/empty_enum.rs @@ -1,9 +1,10 @@ //! lint when there is an enum with no variants use crate::utils::span_lint_and_then; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for `enum`s with no variants. diff --git a/clippy_lints/src/entry.rs b/clippy_lints/src/entry.rs index 1ba539c85..4403ef45c 100644 --- a/clippy_lints/src/entry.rs +++ b/clippy_lints/src/entry.rs @@ -2,11 +2,12 @@ use crate::utils::SpanlessEq; use crate::utils::{get_item_name, higher, match_type, paths, snippet, snippet_opt}; 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index abdfe409b..c4b368a6e 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -3,13 +3,14 @@ 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::mir::interpret::GlobalId; use rustc::ty; use rustc::ty::subst::InternalSubsts; use rustc::ty::util::IntTypeExt; -use rustc::{declare_lint_pass, declare_tool_lint}; +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 64f340dff..549518d3c 100644 --- a/clippy_lints/src/enum_glob_use.rs +++ b/clippy_lints/src/enum_glob_use.rs @@ -1,10 +1,11 @@ //! lint on `use`ing all variants of an enum 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index b64e97fba..46c8bbd95 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -2,8 +2,9 @@ use crate::utils::{camel_case, is_present_in_source}; use crate::utils::{span_help_and_lint, span_lint}; +use rustc::impl_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, Lint, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax::source_map::Span; use syntax::symbol::Symbol; diff --git a/clippy_lints/src/eq_op.rs b/clippy_lints/src/eq_op.rs index de7118916..392fb0a6b 100644 --- a/clippy_lints/src/eq_op.rs +++ b/clippy_lints/src/eq_op.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for equal operands to comparison, logical and diff --git a/clippy_lints/src/erasing_op.rs b/clippy_lints/src/erasing_op.rs index 267f1a279..4fa0a232e 100644 --- a/clippy_lints/src/erasing_op.rs +++ b/clippy_lints/src/erasing_op.rs @@ -1,6 +1,7 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use crate::consts::{constant_simple, Constant}; diff --git a/clippy_lints/src/escape.rs b/clippy_lints/src/escape.rs index e796b4659..8554b879b 100644 --- a/clippy_lints/src/escape.rs +++ b/clippy_lints/src/escape.rs @@ -1,10 +1,11 @@ use rustc::hir::intravisit as visit; 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::util::nodemap::HirIdSet; -use rustc::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use rustc_typeck::expr_use_visitor::*; use syntax::source_map::Span; diff --git a/clippy_lints/src/eta_reduction.rs b/clippy_lints/src/eta_reduction.rs index d22ae970d..54fdde67d 100644 --- a/clippy_lints/src/eta_reduction.rs +++ b/clippy_lints/src/eta_reduction.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use crate::utils::{ implements_trait, is_adjusted, iter_input_pats, snippet_opt, span_lint_and_then, type_is_unsafe_function, diff --git a/clippy_lints/src/eval_order_dependence.rs b/clippy_lints/src/eval_order_dependence.rs index e32e15be0..7967d99d1 100644 --- a/clippy_lints/src/eval_order_dependence.rs +++ b/clippy_lints/src/eval_order_dependence.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for a read and a write to the same variable where diff --git a/clippy_lints/src/excessive_precision.rs b/clippy_lints/src/excessive_precision.rs index 40dbaa177..633cd2de8 100644 --- a/clippy_lints/src/excessive_precision.rs +++ b/clippy_lints/src/excessive_precision.rs @@ -1,11 +1,12 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::f32; use std::f64; use std::fmt; diff --git a/clippy_lints/src/exit.rs b/clippy_lints/src/exit.rs index 986c3d97b..42139f1c7 100644 --- a/clippy_lints/src/exit.rs +++ b/clippy_lints/src/exit.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** `exit()` terminates the program and doesn't provide a diff --git a/clippy_lints/src/explicit_write.rs b/clippy_lints/src/explicit_write.rs index e89c8fc6c..9ebda4f11 100644 --- a/clippy_lints/src/explicit_write.rs +++ b/clippy_lints/src/explicit_write.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; declare_clippy_lint! { diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index 10db2bdef..329e5cd1f 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -1,10 +1,11 @@ use crate::utils::paths::{BEGIN_PANIC, BEGIN_PANIC_FMT, FROM_TRAIT, OPTION, RESULT}; 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax_pos::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs index 33ce4f8ff..052684818 100644 --- a/clippy_lints/src/format.rs +++ b/clippy_lints/src/format.rs @@ -4,10 +4,11 @@ use crate::utils::{ walk_ptrs_ty, }; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Span; diff --git a/clippy_lints/src/formatting.rs b/clippy_lints/src/formatting.rs index 626062574..b8f25ea13 100644 --- a/clippy_lints/src/formatting.rs +++ b/clippy_lints/src/formatting.rs @@ -1,7 +1,8 @@ use crate::utils::{differing_macro_contexts, snippet_opt, span_help_and_lint, span_note_and_lint}; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; declare_clippy_lint! { diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs index effd2dc58..f2ac83139 100644 --- a/clippy_lints/src/functions.rs +++ b/clippy_lints/src/functions.rs @@ -4,11 +4,12 @@ use crate::utils::{ }; use matches::matches; use rustc::hir::{self, def::Res, def_id::DefId, intravisit}; +use rustc::impl_lint_pass; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; -use rustc::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use rustc_target::spec::abi::Abi; use syntax::ast::Attribute; use syntax::source_map::Span; diff --git a/clippy_lints/src/get_last_with_len.rs b/clippy_lints/src/get_last_with_len.rs index a43bc3ec1..3d38d2db6 100644 --- a/clippy_lints/src/get_last_with_len.rs +++ b/clippy_lints/src/get_last_with_len.rs @@ -2,10 +2,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Spanned; use syntax::symbol::Symbol; diff --git a/clippy_lints/src/identity_conversion.rs b/clippy_lints/src/identity_conversion.rs index da2110485..c37bb0270 100644 --- a/clippy_lints/src/identity_conversion.rs +++ b/clippy_lints/src/identity_conversion.rs @@ -2,9 +2,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::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for always-identical `Into`/`From`/`IntoIter` conversions. diff --git a/clippy_lints/src/identity_op.rs b/clippy_lints/src/identity_op.rs index 58f5740bf..a4575c2c3 100644 --- a/clippy_lints/src/identity_op.rs +++ b/clippy_lints/src/identity_op.rs @@ -1,7 +1,8 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use crate::consts::{constant_simple, Constant}; diff --git a/clippy_lints/src/if_not_else.rs b/clippy_lints/src/if_not_else.rs index 74f98d634..7019cfa8c 100644 --- a/clippy_lints/src/if_not_else.rs +++ b/clippy_lints/src/if_not_else.rs @@ -1,8 +1,9 @@ //! lint on if branches that could be swapped so no `!` operation is necessary //! on the condition +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; use crate::utils::span_help_and_lint; diff --git a/clippy_lints/src/implicit_return.rs b/clippy_lints/src/implicit_return.rs index c6cf021af..b926526e7 100644 --- a/clippy_lints/src/implicit_return.rs +++ b/clippy_lints/src/implicit_return.rs @@ -5,11 +5,12 @@ use crate::utils::{ }; use if_chain::if_chain; use rustc::{ - declare_lint_pass, declare_tool_lint, + declare_lint_pass, hir::{intravisit::FnKind, Body, Expr, ExprKind, FnDecl, HirId, MatchSource, StmtKind}, lint::{LateContext, LateLintPass, LintArray, LintPass}, }; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/indexing_slicing.rs b/clippy_lints/src/indexing_slicing.rs index a2dbd09d8..1d42158b4 100644 --- a/clippy_lints/src/indexing_slicing.rs +++ b/clippy_lints/src/indexing_slicing.rs @@ -4,10 +4,11 @@ use crate::consts::{constant, Constant}; 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::RangeLimits; declare_clippy_lint! { diff --git a/clippy_lints/src/infallible_destructuring_match.rs b/clippy_lints/src/infallible_destructuring_match.rs index 015251a4f..a9539534e 100644 --- a/clippy_lints/src/infallible_destructuring_match.rs +++ b/clippy_lints/src/infallible_destructuring_match.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for matches being used to destructure a single-variant enum diff --git a/clippy_lints/src/infinite_iter.rs b/clippy_lints/src/infinite_iter.rs index 63eb6187e..b8d50e4ef 100644 --- a/clippy_lints/src/infinite_iter.rs +++ b/clippy_lints/src/infinite_iter.rs @@ -1,6 +1,7 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +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 063aade4e..91d0f4915 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -2,9 +2,10 @@ 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::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashMap; +use rustc_session::declare_tool_lint; use syntax_pos::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/inherent_to_string.rs b/clippy_lints/src/inherent_to_string.rs index da2b72630..d1ed6f3bb 100644 --- a/clippy_lints/src/inherent_to_string.rs +++ b/clippy_lints/src/inherent_to_string.rs @@ -1,7 +1,8 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::{ImplItem, ImplItemKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use crate::utils::{ get_trait_def_id, implements_trait, match_type, paths, return_ty, span_help_and_lint, trait_ref_of_method, diff --git a/clippy_lints/src/inline_fn_without_body.rs b/clippy_lints/src/inline_fn_without_body.rs index 8c848f697..0e8531e6d 100644 --- a/clippy_lints/src/inline_fn_without_body.rs +++ b/clippy_lints/src/inline_fn_without_body.rs @@ -2,10 +2,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::{Attribute, Name}; declare_clippy_lint! { diff --git a/clippy_lints/src/int_plus_one.rs b/clippy_lints/src/int_plus_one.rs index 93e09315f..9a039929e 100644 --- a/clippy_lints/src/int_plus_one.rs +++ b/clippy_lints/src/int_plus_one.rs @@ -1,8 +1,9 @@ //! lint on blocks unnecessarily using >= with a + 1 or - 1 +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; use crate::utils::{snippet_opt, span_lint_and_then}; diff --git a/clippy_lints/src/integer_division.rs b/clippy_lints/src/integer_division.rs index efdd1b6a7..4964fc6b4 100644 --- a/clippy_lints/src/integer_division.rs +++ b/clippy_lints/src/integer_division.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for division of integers diff --git a/clippy_lints/src/items_after_statements.rs b/clippy_lints/src/items_after_statements.rs index a0a7e58ac..06ed5e29c 100644 --- a/clippy_lints/src/items_after_statements.rs +++ b/clippy_lints/src/items_after_statements.rs @@ -2,8 +2,9 @@ use crate::utils::span_lint; use matches::matches; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; declare_clippy_lint! { diff --git a/clippy_lints/src/large_enum_variant.rs b/clippy_lints/src/large_enum_variant.rs index d612a4326..cfc4857d6 100644 --- a/clippy_lints/src/large_enum_variant.rs +++ b/clippy_lints/src/large_enum_variant.rs @@ -2,10 +2,11 @@ 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::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for large size differences between variants on diff --git a/clippy_lints/src/large_stack_arrays.rs b/clippy_lints/src/large_stack_arrays.rs index 975a96c9a..4cfa50b3f 100644 --- a/clippy_lints/src/large_stack_arrays.rs +++ b/clippy_lints/src/large_stack_arrays.rs @@ -1,8 +1,9 @@ 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::{declare_tool_lint, impl_lint_pass}; +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 df4aacf75..3081fc856 100644 --- a/clippy_lints/src/len_zero.rs +++ b/clippy_lints/src/len_zero.rs @@ -1,11 +1,12 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::{LitKind, Name}; use syntax::source_map::{Span, Spanned}; diff --git a/clippy_lints/src/let_if_seq.rs b/clippy_lints/src/let_if_seq.rs index 541c25ae6..a7dae9497 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::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for variable declarations immediately followed by a diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index c1113daad..432a38a11 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -35,6 +35,8 @@ extern crate rustc_mir; #[allow(unused_extern_crates)] extern crate rustc_parse; #[allow(unused_extern_crates)] +extern crate rustc_session; +#[allow(unused_extern_crates)] extern crate rustc_target; #[allow(unused_extern_crates)] extern crate rustc_typeck; @@ -69,9 +71,11 @@ use toml; /// # #![feature(rustc_private)] /// # #[allow(unused_extern_crates)] /// # extern crate rustc; +/// # #[allow(unused_extern_crates)] +/// # extern crate rustc_session; /// # #[macro_use] /// # use clippy_lints::declare_clippy_lint; -/// use rustc::declare_tool_lint; +/// use rustc_session::declare_tool_lint; /// /// declare_clippy_lint! { /// /// **What it does:** Checks for ... (describe what the lint matches). diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index fe8938c58..012030472 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::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use syntax::symbol::kw; diff --git a/clippy_lints/src/literal_representation.rs b/clippy_lints/src/literal_representation.rs index 8aa0e8729..24f40a161 100644 --- a/clippy_lints/src/literal_representation.rs +++ b/clippy_lints/src/literal_representation.rs @@ -4,8 +4,9 @@ use crate::utils::{in_macro, snippet_opt, span_lint_and_sugg}; use if_chain::if_chain; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint, impl_lint_pass}; +use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax_pos; diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index 4212f9c1e..740605c9e 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -1,13 +1,14 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; // use rustc::middle::region::CodeExtent; use crate::consts::{constant, Constant}; use crate::utils::usage::mutated_variables; diff --git a/clippy_lints/src/main_recursion.rs b/clippy_lints/src/main_recursion.rs index 5e51b6b75..fa27890ea 100644 --- a/clippy_lints/src/main_recursion.rs +++ b/clippy_lints/src/main_recursion.rs @@ -1,6 +1,7 @@ use rustc::hir::{Crate, Expr, ExprKind, QPath}; +use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use syntax::ast::AttrKind; use syntax::symbol::sym; diff --git a/clippy_lints/src/map_clone.rs b/clippy_lints/src/map_clone.rs index 1893f4ed2..1f3954d56 100644 --- a/clippy_lints/src/map_clone.rs +++ b/clippy_lints/src/map_clone.rs @@ -3,11 +3,12 @@ use crate::utils::{ is_copy, match_trait_method, match_type, 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::ty; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::Ident; use syntax::source_map::Span; diff --git a/clippy_lints/src/map_unit_fn.rs b/clippy_lints/src/map_unit_fn.rs index 8b2bcce47..83dd1180e 100644 --- a/clippy_lints/src/map_unit_fn.rs +++ b/clippy_lints/src/map_unit_fn.rs @@ -1,11 +1,12 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 96daaec7f..75f867471 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -6,12 +6,13 @@ use crate::utils::{ snippet_with_applicability, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty, }; 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::cmp::Ordering; use std::collections::Bound; use syntax::ast::LitKind; diff --git a/clippy_lints/src/mem_discriminant.rs b/clippy_lints/src/mem_discriminant.rs index 14b9fd84c..989c254fe 100644 --- a/clippy_lints/src/mem_discriminant.rs +++ b/clippy_lints/src/mem_discriminant.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +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 fb98be92a..fc3c5ab5d 100644 --- a/clippy_lints/src/mem_forget.rs +++ b/clippy_lints/src/mem_forget.rs @@ -1,7 +1,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for usage of `std::mem::forget(t)` where `t` is diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs index 6a3fda91e..71a7b0105 100644 --- a/clippy_lints/src/mem_replace.rs +++ b/clippy_lints/src/mem_replace.rs @@ -2,10 +2,11 @@ use crate::utils::{ match_def_path, match_qpath, paths, snippet_with_applicability, span_help_and_lint, span_lint_and_sugg, }; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, QPath}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for `mem::replace()` on an `Option` with diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 057d1f3be..ca62e7ea9 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -9,12 +9,13 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast; use syntax::source_map::Span; use syntax::symbol::{sym, Symbol, SymbolStr}; diff --git a/clippy_lints/src/minmax.rs b/clippy_lints/src/minmax.rs index 7b2d73a3b..7e2ec8f49 100644 --- a/clippy_lints/src/minmax.rs +++ b/clippy_lints/src/minmax.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use std::cmp::Ordering; declare_clippy_lint! { diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 24c167c42..07a9d4b33 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -1,11 +1,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::ty; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::{ExpnKind, Span}; diff --git a/clippy_lints/src/misc_early.rs b/clippy_lints/src/misc_early.rs index d756980b3..7f70de01d 100644 --- a/clippy_lints/src/misc_early.rs +++ b/clippy_lints/src/misc_early.rs @@ -3,10 +3,11 @@ use crate::utils::{ span_lint_and_then, }; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax::source_map::Span; use syntax::visit::{walk_expr, FnKind, Visitor}; diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index d97e3ed88..be7df2670 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -1,10 +1,11 @@ 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, HirVec}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn; +use rustc_session::declare_tool_lint; use rustc_typeck::hir_ty_to_ty; use syntax_pos::Span; diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 949bd4bce..a61034ce0 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -8,9 +8,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::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use syntax::ast::{self, MetaItem, MetaItemKind}; use syntax::attr; use syntax::source_map::Span; diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index 927ead77a..9eee8bc10 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -1,7 +1,8 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::hir; use rustc::lint::{self, LateContext, LateLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast; use syntax::source_map::Span; diff --git a/clippy_lints/src/mul_add.rs b/clippy_lints/src/mul_add.rs index 5263bfbd3..e6a68ac5c 100644 --- a/clippy_lints/src/mul_add.rs +++ b/clippy_lints/src/mul_add.rs @@ -1,7 +1,8 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use crate::utils::*; diff --git a/clippy_lints/src/multiple_crate_versions.rs b/clippy_lints/src/multiple_crate_versions.rs index 483d8944e..db2263110 100644 --- a/clippy_lints/src/multiple_crate_versions.rs +++ b/clippy_lints/src/multiple_crate_versions.rs @@ -1,8 +1,9 @@ //! lint on multiple versions of a crate being used use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::{ast::*, source_map::DUMMY_SP}; use cargo_metadata; diff --git a/clippy_lints/src/mut_mut.rs b/clippy_lints/src/mut_mut.rs index 2b978230c..7be792918 100644 --- a/clippy_lints/src/mut_mut.rs +++ b/clippy_lints/src/mut_mut.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for instances of `mut mut` references. diff --git a/clippy_lints/src/mut_reference.rs b/clippy_lints/src/mut_reference.rs index 9788e6cda..326725e63 100644 --- a/clippy_lints/src/mut_reference.rs +++ b/clippy_lints/src/mut_reference.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Detects giving a mutable reference to a function that only diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs index 67cb696b4..51180300e 100644 --- a/clippy_lints/src/mutable_debug_assertion.rs +++ b/clippy_lints/src/mutable_debug_assertion.rs @@ -4,7 +4,8 @@ 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, declare_tool_lint, ty}; +use rustc::{declare_lint_pass, ty}; +use rustc_session::declare_tool_lint; use syntax_pos::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/mutex_atomic.rs b/clippy_lints/src/mutex_atomic.rs index a8c953b88..89865bbaa 100644 --- a/clippy_lints/src/mutex_atomic.rs +++ b/clippy_lints/src/mutex_atomic.rs @@ -3,10 +3,11 @@ //! This lint is **warn** by default 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast; declare_clippy_lint! { diff --git a/clippy_lints/src/needless_bool.rs b/clippy_lints/src/needless_bool.rs index dffce2215..7e8540ffd 100644 --- a/clippy_lints/src/needless_bool.rs +++ b/clippy_lints/src/needless_bool.rs @@ -4,10 +4,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Spanned; diff --git a/clippy_lints/src/needless_borrow.rs b/clippy_lints/src/needless_borrow.rs index 2b4d8d0c7..b2ac95302 100644 --- a/clippy_lints/src/needless_borrow.rs +++ b/clippy_lints/src/needless_borrow.rs @@ -5,11 +5,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::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for address of operations (`&`) that are going to diff --git a/clippy_lints/src/needless_borrowed_ref.rs b/clippy_lints/src/needless_borrowed_ref.rs index aab194068..845e5d642 100644 --- a/clippy_lints/src/needless_borrowed_ref.rs +++ b/clippy_lints/src/needless_borrowed_ref.rs @@ -4,10 +4,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for useless borrowed references. diff --git a/clippy_lints/src/needless_continue.rs b/clippy_lints/src/needless_continue.rs index 8fa30f682..537c2d659 100644 --- a/clippy_lints/src/needless_continue.rs +++ b/clippy_lints/src/needless_continue.rs @@ -33,8 +33,9 @@ //! ``` //! //! This lint is **warn** by default. +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use std::borrow::Cow; use syntax::ast; use syntax::source_map::{original_sp, DUMMY_SP}; diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 05894de5c..f532f6fbe 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -5,14 +5,15 @@ use crate::utils::{ }; 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::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use rustc_target::spec::abi::Abi; use rustc_typeck::expr_use_visitor as euv; use std::borrow::Cow; diff --git a/clippy_lints/src/needless_update.rs b/clippy_lints/src/needless_update.rs index a92523eb5..77483bc12 100644 --- a/clippy_lints/src/needless_update.rs +++ b/clippy_lints/src/needless_update.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for needlessly including a base struct on update 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 f25a00ca6..432d2552f 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,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +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 3ef3ee36c..6b76479ce 100644 --- a/clippy_lints/src/neg_multiply.rs +++ b/clippy_lints/src/neg_multiply.rs @@ -1,7 +1,8 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use crate::consts::{self, Constant}; diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index f6bb2e4cf..7e7d31b2b 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -4,11 +4,12 @@ use crate::utils::{get_trait_def_id, implements_trait, return_ty, same_tys, span use if_chain::if_chain; use rustc::hir; use rustc::hir::def_id::DefId; +use rustc::impl_lint_pass; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty::{self, Ty}; use rustc::util::nodemap::HirIdSet; -use rustc::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/no_effect.rs b/clippy_lints/src/no_effect.rs index 63cd44fb2..8ce4f1a78 100644 --- a/clippy_lints/src/no_effect.rs +++ b/clippy_lints/src/no_effect.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::ops::Deref; declare_clippy_lint! { diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index 9cddd812b..d8469303e 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -4,12 +4,13 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use rustc_typeck::hir_ty_to_ty; use syntax_pos::{InnerSpan, Span, DUMMY_SP}; diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs index 8ac31743a..d2835ba98 100644 --- a/clippy_lints/src/non_expressive_names.rs +++ b/clippy_lints/src/non_expressive_names.rs @@ -1,6 +1,7 @@ use crate::utils::{span_lint, span_lint_and_then}; +use rustc::impl_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; +use rustc_session::declare_tool_lint; use std::cmp::Ordering; use syntax::ast::*; use syntax::attr; diff --git a/clippy_lints/src/ok_if_let.rs b/clippy_lints/src/ok_if_let.rs index 6973909b7..6a9c7288f 100644 --- a/clippy_lints/src/ok_if_let.rs +++ b/clippy_lints/src/ok_if_let.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:*** Checks for unnecessary `ok()` in if let. diff --git a/clippy_lints/src/open_options.rs b/clippy_lints/src/open_options.rs index cc8d17e28..03261cdd7 100644 --- a/clippy_lints/src/open_options.rs +++ b/clippy_lints/src/open_options.rs @@ -1,7 +1,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::{Span, Spanned}; diff --git a/clippy_lints/src/overflow_check_conditional.rs b/clippy_lints/src/overflow_check_conditional.rs index b14f04d0a..749d0e979 100644 --- a/clippy_lints/src/overflow_check_conditional.rs +++ b/clippy_lints/src/overflow_check_conditional.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Detects classic underflow/overflow checks. diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index 87ef5f903..cb6d92534 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax_pos::Span; diff --git a/clippy_lints/src/partialeq_ne_impl.rs b/clippy_lints/src/partialeq_ne_impl.rs index ad046edf2..a78c27fb7 100644 --- a/clippy_lints/src/partialeq_ne_impl.rs +++ b/clippy_lints/src/partialeq_ne_impl.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for manual re-implementations of `PartialEq::ne`. diff --git a/clippy_lints/src/path_buf_push_overwrite.rs b/clippy_lints/src/path_buf_push_overwrite.rs index eee60e33b..4c7d2eedd 100644 --- a/clippy_lints/src/path_buf_push_overwrite.rs +++ b/clippy_lints/src/path_buf_push_overwrite.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::path::{Component, Path}; use syntax::ast::LitKind; diff --git a/clippy_lints/src/precedence.rs b/clippy_lints/src/precedence.rs index a0bcba17d..f259f9fb0 100644 --- a/clippy_lints/src/precedence.rs +++ b/clippy_lints/src/precedence.rs @@ -1,7 +1,8 @@ use crate::utils::{snippet_with_applicability, span_lint_and_sugg}; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax::source_map::Spanned; diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index 7c9e8d294..2043aa838 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -6,12 +6,13 @@ use crate::utils::{ walk_ptrs_hir_ty, }; 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::borrow::Cow; use syntax::source_map::Span; use syntax_pos::{MultiSpan, Symbol}; diff --git a/clippy_lints/src/ptr_offset_with_cast.rs b/clippy_lints/src/ptr_offset_with_cast.rs index 5c5091581..f454e5ac2 100644 --- a/clippy_lints/src/ptr_offset_with_cast.rs +++ b/clippy_lints/src/ptr_offset_with_cast.rs @@ -1,8 +1,9 @@ use crate::utils; +use rustc::declare_lint_pass; use rustc::hir::{Expr, ExprKind}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::fmt; declare_clippy_lint! { diff --git a/clippy_lints/src/question_mark.rs b/clippy_lints/src/question_mark.rs index fd8133066..ccd320891 100644 --- a/clippy_lints/src/question_mark.rs +++ b/clippy_lints/src/question_mark.rs @@ -1,10 +1,11 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::def::{DefKind, Res}; use rustc::hir::ptr::P; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use crate::utils::paths::*; use crate::utils::sugg::Sugg; diff --git a/clippy_lints/src/ranges.rs b/clippy_lints/src/ranges.rs index 03a969c9e..b2db5f936 100644 --- a/clippy_lints/src/ranges.rs +++ b/clippy_lints/src/ranges.rs @@ -1,8 +1,9 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::RangeLimits; use syntax::source_map::Spanned; diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index ca0d6ace0..6ed3c0734 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -4,6 +4,7 @@ use crate::utils::{ }; 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}; @@ -12,13 +13,13 @@ use rustc::mir::{ visit::{MutatingUseContext, PlaceContext, Visitor as _}, }; use rustc::ty::{self, fold::TypeVisitor, Ty}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::{fx::FxHashMap, transitive_relation::TransitiveRelation}; use rustc_errors::Applicability; use rustc_index::bit_set::{BitSet, HybridBitSet}; use rustc_mir::dataflow::{ do_dataflow, BitDenotation, BottomValue, DataflowResults, DataflowResultsCursor, DebugFormatted, GenKillSet, }; +use rustc_session::declare_tool_lint; use std::convert::TryFrom; use syntax::source_map::{BytePos, Span}; diff --git a/clippy_lints/src/redundant_field_names.rs b/clippy_lints/src/redundant_field_names.rs index c666ca936..46010af1c 100644 --- a/clippy_lints/src/redundant_field_names.rs +++ b/clippy_lints/src/redundant_field_names.rs @@ -1,7 +1,8 @@ use crate::utils::span_lint_and_sugg; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; declare_clippy_lint! { diff --git a/clippy_lints/src/redundant_pattern_matching.rs b/clippy_lints/src/redundant_pattern_matching.rs index 2af3634be..e36237ab2 100644 --- a/clippy_lints/src/redundant_pattern_matching.rs +++ b/clippy_lints/src/redundant_pattern_matching.rs @@ -1,9 +1,10 @@ use crate::utils::{match_qpath, paths, snippet, span_lint_and_then}; +use rustc::declare_lint_pass; use rustc::hir::ptr::P; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; declare_clippy_lint! { diff --git a/clippy_lints/src/redundant_static_lifetimes.rs b/clippy_lints/src/redundant_static_lifetimes.rs index 06af5f9ec..18bf3ed21 100644 --- a/clippy_lints/src/redundant_static_lifetimes.rs +++ b/clippy_lints/src/redundant_static_lifetimes.rs @@ -1,7 +1,8 @@ use crate::utils::{snippet, span_lint_and_then}; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::*; declare_clippy_lint! { diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs index 28ff69075..6bb4236b0 100644 --- a/clippy_lints/src/reference.rs +++ b/clippy_lints/src/reference.rs @@ -1,8 +1,9 @@ use crate::utils::{in_macro, snippet_with_applicability, span_lint_and_sugg}; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::{Expr, ExprKind, UnOp}; declare_clippy_lint! { diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index f9734441d..6f7d60b0d 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -3,9 +3,10 @@ use crate::utils::{is_expn_of, match_def_path, match_type, paths, span_help_and_ use if_chain::if_chain; use regex_syntax; use rustc::hir::*; +use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashSet; +use rustc_session::declare_tool_lint; use std::convert::TryFrom; use syntax::ast::{LitKind, StrStyle}; use syntax::source_map::{BytePos, Span}; diff --git a/clippy_lints/src/replace_consts.rs b/clippy_lints/src/replace_consts.rs index 6bbccfa09..3cca42ce0 100644 --- a/clippy_lints/src/replace_consts.rs +++ b/clippy_lints/src/replace_consts.rs @@ -1,10 +1,11 @@ use crate::utils::{match_def_path, span_lint_and_sugg}; use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::hir; use rustc::hir::def::{DefKind, Res}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for usage of `ATOMIC_X_INIT`, `ONCE_INIT`, and diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs index 5ed95a674..c3afa1560 100644 --- a/clippy_lints/src/returns.rs +++ b/clippy_lints/src/returns.rs @@ -1,7 +1,8 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast; use syntax::source_map::Span; use syntax::visit::FnKind; diff --git a/clippy_lints/src/serde_api.rs b/clippy_lints/src/serde_api.rs index a71a7fdab..5fb517abc 100644 --- a/clippy_lints/src/serde_api.rs +++ b/clippy_lints/src/serde_api.rs @@ -1,7 +1,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for mis-uses of the serde API. diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index f6749a314..5d2767d84 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/slow_vector_initialization.rs b/clippy_lints/src/slow_vector_initialization.rs index 41d8980e7..115feefe2 100644 --- a/clippy_lints/src/slow_vector_initialization.rs +++ b/clippy_lints/src/slow_vector_initialization.rs @@ -1,11 +1,12 @@ use crate::utils::sugg::Sugg; use crate::utils::{get_enclosing_block, match_qpath, span_lint_and_then, SpanlessEq}; 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax_pos::symbol::Symbol; diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index 00e2441be..5261d8585 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -1,7 +1,8 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Spanned; use if_chain::if_chain; diff --git a/clippy_lints/src/suspicious_trait_impl.rs b/clippy_lints/src/suspicious_trait_impl.rs index c91768be6..b3520c181 100644 --- a/clippy_lints/src/suspicious_trait_impl.rs +++ b/clippy_lints/src/suspicious_trait_impl.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Lints for suspicious operations in impls of arithmetic operators, e.g. diff --git a/clippy_lints/src/swap.rs b/clippy_lints/src/swap.rs index b79242391..f47945f0a 100644 --- a/clippy_lints/src/swap.rs +++ b/clippy_lints/src/swap.rs @@ -5,11 +5,12 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax_pos::Symbol; declare_clippy_lint! { diff --git a/clippy_lints/src/tabs_in_doc_comments.rs b/clippy_lints/src/tabs_in_doc_comments.rs index ccea700f3..8a46bcc58 100644 --- a/clippy_lints/src/tabs_in_doc_comments.rs +++ b/clippy_lints/src/tabs_in_doc_comments.rs @@ -1,7 +1,8 @@ use crate::utils::span_lint_and_sugg; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use std::convert::TryFrom; use syntax::ast; use syntax::source_map::{BytePos, Span}; diff --git a/clippy_lints/src/temporary_assignment.rs b/clippy_lints/src/temporary_assignment.rs index 72d1e982d..771be56cb 100644 --- a/clippy_lints/src/temporary_assignment.rs +++ b/clippy_lints/src/temporary_assignment.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for construction of a structure or tuple just to diff --git a/clippy_lints/src/to_digit_is_some.rs b/clippy_lints/src/to_digit_is_some.rs index a40d92f38..250ddd5ad 100644 --- a/clippy_lints/src/to_digit_is_some.rs +++ b/clippy_lints/src/to_digit_is_some.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for `.to_digit(..).is_some()` on `char`s. diff --git a/clippy_lints/src/trait_bounds.rs b/clippy_lints/src/trait_bounds.rs index edb91d617..2ad2cb678 100644 --- a/clippy_lints/src/trait_bounds.rs +++ b/clippy_lints/src/trait_bounds.rs @@ -1,8 +1,9 @@ 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::{declare_tool_lint, impl_lint_pass}; use rustc_data_structures::fx::FxHashMap; +use rustc_session::declare_tool_lint; #[derive(Copy, Clone)] pub struct TraitBounds; diff --git a/clippy_lints/src/transmute.rs b/clippy_lints/src/transmute.rs index f12fd6bb0..12de3023d 100644 --- a/clippy_lints/src/transmute.rs +++ b/clippy_lints/src/transmute.rs @@ -1,10 +1,11 @@ use crate::utils::{last_path_segment, match_def_path, paths, snippet, span_lint, span_lint_and_then, 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +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 9d1d783f6..451725761 100644 --- a/clippy_lints/src/transmuting_null.rs +++ b/clippy_lints/src/transmuting_null.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; declare_clippy_lint! { diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs index 10f36d7fd..7bfc9a05b 100644 --- a/clippy_lints/src/trivially_copy_pass_by_ref.rs +++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs @@ -6,11 +6,12 @@ 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::{declare_tool_lint, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use rustc_target::abi::LayoutOf; use rustc_target::spec::abi::Abi; use syntax_pos::Span; diff --git a/clippy_lints/src/try_err.rs b/clippy_lints/src/try_err.rs index 0985f966e..8c3e755ef 100644 --- a/clippy_lints/src/try_err.rs +++ b/clippy_lints/src/try_err.rs @@ -1,10 +1,11 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for usages of `Err(x)?`. diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 6a105a87e..4ef888876 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -11,8 +11,9 @@ 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, declare_tool_lint, impl_lint_pass}; +use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use rustc_target::spec::abi::Abi; use rustc_typeck::hir_ty_to_ty; use syntax::ast::{FloatTy, IntTy, LitFloatType, LitIntType, LitKind, UintTy}; diff --git a/clippy_lints/src/unicode.rs b/clippy_lints/src/unicode.rs index 7726b05a2..1024e7165 100644 --- a/clippy_lints/src/unicode.rs +++ b/clippy_lints/src/unicode.rs @@ -1,8 +1,9 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast::LitKind; use syntax::source_map::Span; use unicode_normalization::UnicodeNormalization; diff --git a/clippy_lints/src/unsafe_removed_from_name.rs b/clippy_lints/src/unsafe_removed_from_name.rs index 2f0e406b1..58af6e9d2 100644 --- a/clippy_lints/src/unsafe_removed_from_name.rs +++ b/clippy_lints/src/unsafe_removed_from_name.rs @@ -1,6 +1,7 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax::source_map::Span; use syntax::symbol::SymbolStr; diff --git a/clippy_lints/src/unused_io_amount.rs b/clippy_lints/src/unused_io_amount.rs index 6f02d56b8..41182e3ca 100644 --- a/clippy_lints/src/unused_io_amount.rs +++ b/clippy_lints/src/unused_io_amount.rs @@ -1,7 +1,8 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for unused written/read amount. diff --git a/clippy_lints/src/unused_label.rs b/clippy_lints/src/unused_label.rs index 721458e1d..60acbc146 100644 --- a/clippy_lints/src/unused_label.rs +++ b/clippy_lints/src/unused_label.rs @@ -1,9 +1,10 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::hir; use rustc::hir::intravisit::{walk_expr, walk_fn, FnKind, NestedVisitorMap, Visitor}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::FxHashMap; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use syntax::symbol::Symbol; diff --git a/clippy_lints/src/unused_self.rs b/clippy_lints/src/unused_self.rs index 06b11b6c3..bbf6faa2c 100644 --- a/clippy_lints/src/unused_self.rs +++ b/clippy_lints/src/unused_self.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +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 39d3ee184..736150a86 100644 --- a/clippy_lints/src/unwrap.rs +++ b/clippy_lints/src/unwrap.rs @@ -1,6 +1,7 @@ use if_chain::if_chain; +use rustc::declare_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +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::*; diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 23d0ab090..4b9945d20 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -1,4 +1,5 @@ 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}; @@ -6,8 +7,8 @@ use rustc::hir::*; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::ty; use rustc::ty::{DefIdTree, Ty}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax_pos::symbol::kw; use crate::utils::{differing_macro_contexts, span_lint_and_sugg}; diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index c5d070695..a7b049db1 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -2,13 +2,14 @@ //! to generate a clippy lint detecting said code automatically. 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::{declare_lint_pass, declare_tool_lint}; use rustc_data_structures::fx::FxHashMap; +use rustc_session::declare_tool_lint; use syntax::ast::{Attribute, LitFloatType, LitKind}; declare_clippy_lint! { diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 285ce1f5f..6511999ec 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -1,11 +1,12 @@ //! checks for attributes 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::ast::Attribute; declare_clippy_lint! { diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index ea7ea5818..2ea605edb 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -8,9 +8,10 @@ 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, declare_tool_lint, impl_lint_pass}; +use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::ast; use syntax::ast::{Crate as AstCrate, ItemKind, Name}; use syntax::source_map::Span; diff --git a/clippy_lints/src/utils/paths.rs b/clippy_lints/src/utils/paths.rs index 042ca4ee7..86648f9d3 100644 --- a/clippy_lints/src/utils/paths.rs +++ b/clippy_lints/src/utils/paths.rs @@ -46,7 +46,7 @@ pub const IO_WRITE: [&str; 3] = ["std", "io", "Write"]; pub const ITERATOR: [&str; 5] = ["core", "iter", "traits", "iterator", "Iterator"]; pub const LATE_CONTEXT: [&str; 4] = ["rustc", "lint", "context", "LateContext"]; pub const LINKED_LIST: [&str; 4] = ["alloc", "collections", "linked_list", "LinkedList"]; -pub const LINT: [&str; 3] = ["rustc", "lint", "Lint"]; +pub const LINT: [&str; 3] = ["rustc_session", "lint", "Lint"]; pub const MEM_DISCRIMINANT: [&str; 3] = ["core", "mem", "discriminant"]; pub const MEM_FORGET: [&str; 3] = ["core", "mem", "forget"]; pub const MEM_MAYBEUNINIT: [&str; 4] = ["core", "mem", "maybe_uninit", "MaybeUninit"]; diff --git a/clippy_lints/src/vec.rs b/clippy_lints/src/vec.rs index 9106e6a81..2779c4b86 100644 --- a/clippy_lints/src/vec.rs +++ b/clippy_lints/src/vec.rs @@ -1,11 +1,12 @@ 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::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; declare_clippy_lint! { diff --git a/clippy_lints/src/wildcard_dependencies.rs b/clippy_lints/src/wildcard_dependencies.rs index b2a66b6d5..bd865bf49 100644 --- a/clippy_lints/src/wildcard_dependencies.rs +++ b/clippy_lints/src/wildcard_dependencies.rs @@ -1,6 +1,7 @@ use crate::utils::span_lint; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::{ast::*, source_map::DUMMY_SP}; use cargo_metadata; diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 5160f0739..08e2d59b4 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -2,11 +2,12 @@ use std::borrow::Cow; use std::ops::Range; use crate::utils::{snippet_with_applicability, span_lint, span_lint_and_sugg, span_lint_and_then}; +use rustc::declare_lint_pass; use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; use rustc_lexer::unescape::{self, EscapeError}; use rustc_parse::parser; +use rustc_session::declare_tool_lint; use syntax::ast::*; use syntax::symbol::Symbol; use syntax::token; diff --git a/clippy_lints/src/zero_div_zero.rs b/clippy_lints/src/zero_div_zero.rs index f866d76a3..ec380360e 100644 --- a/clippy_lints/src/zero_div_zero.rs +++ b/clippy_lints/src/zero_div_zero.rs @@ -1,9 +1,10 @@ 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::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; declare_clippy_lint! { /// **What it does:** Checks for `0.0 / 0.0`. diff --git a/doc/adding_lints.md b/doc/adding_lints.md index e171ecacc..36d0ce020 100644 --- a/doc/adding_lints.md +++ b/doc/adding_lints.md @@ -127,7 +127,8 @@ where all the lint code is. We are going to call the file ```rust use rustc::lint::{LintArray, LintPass, EarlyLintPass}; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc::declare_lint_pass; +use rustc_session::declare_tool_lint; ``` The next step is to provide a lint declaration. Lints are declared using the diff --git a/tests/ui/lint_without_lint_pass.rs b/tests/ui/lint_without_lint_pass.rs index 81353414d..0f6eec521 100644 --- a/tests/ui/lint_without_lint_pass.rs +++ b/tests/ui/lint_without_lint_pass.rs @@ -3,6 +3,8 @@ #[macro_use] extern crate rustc; +#[macro_use] +extern crate rustc_session; use rustc::lint::{LintArray, LintPass}; declare_tool_lint! { diff --git a/tests/ui/lint_without_lint_pass.stderr b/tests/ui/lint_without_lint_pass.stderr index 7ee9d96c1..e7265150f 100644 --- a/tests/ui/lint_without_lint_pass.stderr +++ b/tests/ui/lint_without_lint_pass.stderr @@ -1,5 +1,5 @@ error: the lint `TEST_LINT` is not added to any `LintPass` - --> $DIR/lint_without_lint_pass.rs:8:1 + --> $DIR/lint_without_lint_pass.rs:10:1 | LL | / declare_tool_lint! { LL | | pub clippy::TEST_LINT, diff --git a/tests/ui/outer_expn_data.fixed b/tests/ui/outer_expn_data.fixed index 4118214e6..77c3f93b7 100644 --- a/tests/ui/outer_expn_data.fixed +++ b/tests/ui/outer_expn_data.fixed @@ -5,6 +5,8 @@ #[macro_use] extern crate rustc; +#[macro_use] +extern crate rustc_session; use rustc::hir::Expr; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; diff --git a/tests/ui/outer_expn_data.rs b/tests/ui/outer_expn_data.rs index a6726a9bf..b45f5e1ac 100644 --- a/tests/ui/outer_expn_data.rs +++ b/tests/ui/outer_expn_data.rs @@ -5,6 +5,8 @@ #[macro_use] extern crate rustc; +#[macro_use] +extern crate rustc_session; use rustc::hir::Expr; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; diff --git a/tests/ui/outer_expn_data.stderr b/tests/ui/outer_expn_data.stderr index 15fb0ad2e..514eb599b 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:21:34 + --> $DIR/outer_expn_data.rs:23:34 | LL | let _ = expr.span.ctxt().outer_expn().expn_data(); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `outer_expn_data()`