Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some rustups #5040

Merged
merged 8 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol;
use std::f64::consts as f64;
use syntax::ast::{FloatTy, LitFloatType, LitKind};
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/arithmetic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::consts::constant_simple;
use crate::utils::span_lint;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;

declare_clippy_lint! {
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/as_conversions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use rustc::declare_lint_pass;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;

use crate::utils::span_help_and_lint;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/assertions_on_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ 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::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::LitKind;

declare_clippy_lint! {
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/assign_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ use crate::utils::{
};
use crate::utils::{higher, sugg};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for `a = a op b` or `a = b commutative_op a`
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/atomic_ordering.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::utils::{match_def_path, span_help_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::def_id::DefId;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for usage of invalid atomic
Expand Down
6 changes: 2 additions & 4 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ use crate::utils::{
span_lint_and_then, without_block_comments,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{
in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray,
LintContext, LintPass,
in_external_macro, CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext,
};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use semver::Version;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/bit_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ use crate::consts::{constant, Constant};
use crate::utils::sugg::Sugg;
use crate::utils::{span_lint, span_lint_and_then};
use if_chain::if_chain;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use syntax::ast::LitKind;

Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/blacklisted_name.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::utils::span_lint;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};

declare_clippy_lint! {
/// **What it does:** Checks for usage of blacklisted names for variables, such
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/block_in_if_condition.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::utils::*;
use matches::matches;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for `if` conditions that use blocks to contain an
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ use crate::utils::{
span_lint_and_then, SpanlessEq,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::hir::map::Map;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::intravisit;
use rustc_hir::intravisit::*;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast::LitKind;

Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/bytecount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ use crate::utils::{
span_lint_and_sugg, walk_ptrs_ty,
};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::{Name, UintTy};

declare_clippy_lint! {
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/cargo_common_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
use std::path::PathBuf;

use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::DUMMY_SP;
use syntax::ast::*;

Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/checked_conversions.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! 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::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintContext};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::LitKind;

use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq};
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/cognitive_complexity.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! calculate cognitive complexity and warn about overly complex functions

use rustc::hir::map::Map;
use rustc::impl_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::lint::{LateContext, LateLintPass, LintContext};
use rustc_hir::intravisit::{walk_expr, FnKind, NestedVisitorMap, Visitor};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
use rustc_span::BytePos;
use syntax::ast::Attribute;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/collapsible_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
//! 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_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast;

use crate::utils::sugg::Sugg;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/comparison_chain.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
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::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks comparison chains written with `if` that can be
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/copies.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::utils::{get_parent_expr, higher, if_sequence, same_tys, snippet, span_lint_and_then, span_note_and_lint};
use crate::utils::{SpanlessEq, SpanlessHash};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::Ty;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::symbol::Symbol;
use std::collections::hash_map::Entry;
use std::hash::BuildHasherDefault;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/copy_iterator.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::utils::{is_copy, match_path, paths, span_note_and_lint};
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::{Item, ItemKind};
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for types that implement `Copy` as well as
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/dbg_macro.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
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::lint::{EarlyContext, EarlyLintPass};
use rustc_errors::Applicability;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use syntax::ast;
use syntax::tokenstream::TokenStream;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/default_trait_access.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

use crate::utils::{any_parent_is_automatically_derived, match_def_path, paths, span_lint_and_sugg};

Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
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::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty::{self, Ty};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;

declare_clippy_lint! {
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::utils::{match_type, paths, return_ty, span_lint};
use itertools::Itertools;
use rustc::impl_lint_pass;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{in_external_macro, LateContext, LateLintPass};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::{BytePos, MultiSpan, Span};
use rustc_span::Pos;
use std::ops::Range;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/double_comparison.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//! Lint on unnecessary double comparisons. Some examples:

use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;

use crate::utils::{snippet_with_applicability, span_lint_and_sugg, SpanlessEq};
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/double_parens.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::utils::span_lint;
use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc_session::declare_tool_lint;
use rustc::lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;

declare_clippy_lint! {
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/drop_bounds.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::utils::{match_def_path, paths, span_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateLintPass, LintArray, LintPass};
use rustc::lint::LateLintPass;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for generics with `std::ops::Drop` as bounds.
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/drop_forget_ref.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::utils::{is_copy, match_def_path, paths, qpath_res, span_note_and_lint};
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc::ty;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for calls to `std::mem::drop` with a reference
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/duration_subsec.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use if_chain::if_chain;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_errors::Applicability;
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Spanned;

use crate::consts::{constant, Constant};
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/else_if_without_else.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! 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_session::declare_tool_lint;
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use syntax::ast::*;

use crate::utils::span_help_and_lint;
Expand Down
5 changes: 2 additions & 3 deletions clippy_lints/src/empty_enum.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//! lint when there is an enum with no variants

use crate::utils::span_lint_and_then;
use rustc::declare_lint_pass;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::lint::{LateContext, LateLintPass};
use rustc_hir::*;
use rustc_session::declare_tool_lint;
use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// **What it does:** Checks for `enum`s with no variants.
Expand Down
Loading