Auto merge of #7284 - camsteffen:consts-reexport, r=flip1995

Remove clippy_utils::consts re-export

changelog: none

We got a straggler.
This commit is contained in:
bors 2021-05-27 14:07:12 +00:00
commit 16e347f7b3
31 changed files with 29 additions and 35 deletions

View File

@ -3,9 +3,8 @@ use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty; use rustc_middle::ty;
use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::consts::{constant, Constant};
use clippy_utils::comparisons::{normalize_comparison, Rel}; use clippy_utils::comparisons::{normalize_comparison, Rel};
use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::diagnostics::span_lint_and_help;
use clippy_utils::source::snippet; use clippy_utils::source::snippet;
use clippy_utils::ty::is_isize_or_usize; use clippy_utils::ty::is_isize_or_usize;

View File

@ -1,4 +1,4 @@
use crate::consts::constant_simple; use clippy_utils::consts::constant_simple;
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPass}; use rustc_lint::{LateContext, LateLintPass};

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::diagnostics::span_lint_and_help;
use clippy_utils::source::snippet_opt; use clippy_utils::source::snippet_opt;
use clippy_utils::{is_direct_expn_of, is_expn_of, match_panic_call}; use clippy_utils::{is_direct_expn_of, is_expn_of, match_panic_call};

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_then}; use clippy_utils::diagnostics::{span_lint, span_lint_and_then};
use clippy_utils::sugg::Sugg; use clippy_utils::sugg::Sugg;
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::{method_chain_args, sext}; use clippy_utils::{method_chain_args, sext};
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1 +0,0 @@
pub use clippy_utils::consts::*;

View File

@ -7,7 +7,7 @@ use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::paths; use clippy_utils::paths;

View File

@ -1,7 +1,7 @@
//! lint on C-like enums that are `repr(isize/usize)` and have values that //! lint on C-like enums that are `repr(isize/usize)` and have values that
//! don't fit into an `i32` //! don't fit into an `i32`
use crate::consts::{miri_to_const, Constant}; use clippy_utils::consts::{miri_to_const, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use rustc_hir::{Item, ItemKind}; use rustc_hir::{Item, ItemKind};
use rustc_lint::{LateContext, LateLintPass}; use rustc_lint::{LateContext, LateLintPass};

View File

@ -1,11 +1,10 @@
use clippy_utils::consts::{constant_simple, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass}; use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span; use rustc_span::source_map::Span;
use crate::consts::{constant_simple, Constant};
declare_clippy_lint! { declare_clippy_lint! {
/// **What it does:** Checks for erasing operations, e.g., `x * 0`. /// **What it does:** Checks for erasing operations, e.g., `x * 0`.
/// ///

View File

@ -1,4 +1,4 @@
use crate::consts::{ use clippy_utils::consts::{
constant, constant_simple, Constant, constant, constant_simple, Constant,
Constant::{Int, F32, F64}, Constant::{Int, F32, F64},
}; };

View File

@ -6,7 +6,7 @@ use rustc_middle::ty;
use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span; use rustc_span::source_map::Span;
use crate::consts::{constant_simple, Constant}; use clippy_utils::consts::{constant_simple, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::{clip, unsext}; use clippy_utils::{clip, unsext};

View File

@ -1,6 +1,6 @@
//! lint on indexing and slicing operations //! lint on indexing and slicing operations
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_help}; use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
use clippy_utils::higher; use clippy_utils::higher;
use rustc_ast::ast::RangeLimits; use rustc_ast::ast::RangeLimits;

View File

@ -7,9 +7,8 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span; use rustc_span::Span;
use rustc_target::abi::LayoutOf; use rustc_target::abi::LayoutOf;
use crate::consts::{constant, Constant};
use clippy_utils::comparisons::Rel; use clippy_utils::comparisons::Rel;
use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::source::snippet; use clippy_utils::source::snippet;
use clippy_utils::{comparisons, sext}; use clippy_utils::{comparisons, sext};

View File

@ -148,7 +148,6 @@ macro_rules! declare_clippy_lint {
}; };
} }
mod consts;
#[cfg(feature = "metadata-collector-lint")] #[cfg(feature = "metadata-collector-lint")]
mod deprecated_lints; mod deprecated_lints;
mod utils; mod utils;

View File

@ -1,5 +1,5 @@
use super::WHILE_IMMUTABLE_CONDITION; use super::WHILE_IMMUTABLE_CONDITION;
use crate::consts::constant; use clippy_utils::consts::constant;
use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::usage::mutated_variables; use clippy_utils::usage::mutated_variables;
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::{multispan_sugg, span_lint_and_then}; use clippy_utils::diagnostics::{multispan_sugg, span_lint_and_then};
use clippy_utils::source::snippet; use clippy_utils::source::snippet;
use clippy_utils::usage::mutated_variables; use clippy_utils::usage::mutated_variables;

View File

@ -1,4 +1,4 @@
use crate::consts::constant_simple; use clippy_utils::consts::constant_simple;
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::source::{indent_of, reindent_multiline, snippet_opt}; use clippy_utils::source::{indent_of, reindent_multiline, snippet_opt};
use clippy_utils::ty::is_type_diagnostic_item; use clippy_utils::ty::is_type_diagnostic_item;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, miri_to_const, Constant}; use clippy_utils::consts::{constant, miri_to_const, Constant};
use clippy_utils::diagnostics::{ use clippy_utils::diagnostics::{
multispan_sugg, span_lint_and_help, span_lint_and_note, span_lint_and_sugg, span_lint_and_then, multispan_sugg, span_lint_and_help, span_lint_and_note, span_lint_and_sugg, span_lint_and_then,
}; };

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::is_trait_method; use clippy_utils::is_trait_method;
use clippy_utils::source::snippet_with_applicability; use clippy_utils::source::snippet_with_applicability;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::is_trait_method; use clippy_utils::is_trait_method;
use rustc_hir as hir; use rustc_hir as hir;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant_simple, Constant}; use clippy_utils::consts::{constant_simple, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::{match_def_path, match_trait_method, paths}; use clippy_utils::{match_def_path, match_trait_method, paths};
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -17,7 +17,7 @@ use rustc_span::hygiene::DesugaringKind;
use rustc_span::source_map::{ExpnKind, Span}; use rustc_span::source_map::{ExpnKind, Span};
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::sugg::Sugg; use clippy_utils::sugg::Sugg;
use clippy_utils::{ use clippy_utils::{
expr_path_res, get_item_name, get_parent_expr, higher, in_constant, is_diag_trait_item, is_integer_const, expr_path_res, get_item_name, get_parent_expr, higher, in_constant, is_diag_trait_item, is_integer_const,

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::sext; use clippy_utils::sext;
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1,3 +1,4 @@
use clippy_utils::consts::{self, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use if_chain::if_chain; use if_chain::if_chain;
use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp};
@ -5,8 +6,6 @@ use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span; use rustc_span::source_map::Span;
use crate::consts::{self, Constant};
declare_clippy_lint! { declare_clippy_lint! {
/// **What it does:** Checks for multiplication by -1 as a form of negation. /// **What it does:** Checks for multiplication by -1 as a form of negation.
/// ///

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg, span_lint_and_then}; use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::{snippet, snippet_opt, snippet_with_applicability}; use clippy_utils::source::{snippet, snippet_opt, snippet_with_applicability};
use clippy_utils::sugg::Sugg; use clippy_utils::sugg::Sugg;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant, Constant}; use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_help}; use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
use clippy_utils::{match_def_path, paths}; use clippy_utils::{match_def_path, paths};
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant_context, Constant}; use clippy_utils::consts::{constant_context, Constant};
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::in_macro; use clippy_utils::in_macro;
use clippy_utils::source::snippet; use clippy_utils::source::snippet;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant_context, Constant}; use clippy_utils::consts::{constant_context, Constant};
use clippy_utils::diagnostics::span_lint; use clippy_utils::diagnostics::span_lint;
use clippy_utils::{is_expr_path_def_path, paths}; use clippy_utils::{is_expr_path_def_path, paths};
use if_chain::if_chain; use if_chain::if_chain;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant_simple, Constant}; use clippy_utils::consts::{constant_simple, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then}; use clippy_utils::diagnostics::{span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::snippet; use clippy_utils::source::snippet;
use clippy_utils::ty::match_type; use clippy_utils::ty::match_type;

View File

@ -1,5 +1,5 @@
use crate::consts::{constant, Constant};
use crate::rustc_target::abi::LayoutOf; use crate::rustc_target::abi::LayoutOf;
use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::higher; use clippy_utils::higher;
use clippy_utils::source::snippet_with_applicability; use clippy_utils::source::snippet_with_applicability;

View File

@ -1,4 +1,4 @@
use crate::consts::{constant_simple, Constant}; use clippy_utils::consts::{constant_simple, Constant};
use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::diagnostics::span_lint_and_help;
use if_chain::if_chain; use if_chain::if_chain;
use rustc_hir::{BinOpKind, Expr, ExprKind}; use rustc_hir::{BinOpKind, Expr, ExprKind};