Move 'is_isize_or_usize' to clippy_utils
This commit is contained in:
parent
f098007caa
commit
360f065404
3 changed files with 12 additions and 14 deletions
|
|
@ -15,8 +15,9 @@ use rustc_target::abi::LayoutOf;
|
|||
use crate::consts::{constant, Constant};
|
||||
use crate::utils::sugg::Sugg;
|
||||
use crate::utils::{
|
||||
in_constant, is_hir_ty_cfg_dependant, meets_msrv, method_chain_args, numeric_literal::NumericLiteral, sext,
|
||||
snippet_opt, snippet_with_applicability, span_lint, span_lint_and_sugg, span_lint_and_then,
|
||||
in_constant, is_hir_ty_cfg_dependant, is_isize_or_usize, meets_msrv, method_chain_args,
|
||||
numeric_literal::NumericLiteral, sext, snippet_opt, snippet_with_applicability, span_lint, span_lint_and_sugg,
|
||||
span_lint_and_then,
|
||||
};
|
||||
|
||||
declare_clippy_lint! {
|
||||
|
|
@ -967,7 +968,3 @@ impl<'tcx> LateLintPass<'tcx> for PtrAsPtr {
|
|||
|
||||
extract_msrv_attr!(LateContext);
|
||||
}
|
||||
|
||||
fn is_isize_or_usize(typ: Ty<'_>) -> bool {
|
||||
matches!(typ.kind(), ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ use rustc_typeck::hir_ty_to_ty;
|
|||
use crate::consts::{constant, Constant};
|
||||
use crate::utils::paths;
|
||||
use crate::utils::{
|
||||
clip, comparisons, differing_macro_contexts, higher, indent_of, int_bits, is_type_diagnostic_item, match_path,
|
||||
multispan_sugg, reindent_multiline, sext, snippet, snippet_opt, snippet_with_macro_callsite, span_lint,
|
||||
span_lint_and_help, span_lint_and_then, unsext,
|
||||
clip, comparisons, differing_macro_contexts, higher, indent_of, int_bits, is_isize_or_usize,
|
||||
is_type_diagnostic_item, match_path, multispan_sugg, reindent_multiline, sext, snippet, snippet_opt,
|
||||
snippet_with_macro_callsite, span_lint, span_lint_and_help, span_lint_and_then, unsext,
|
||||
};
|
||||
|
||||
declare_clippy_lint! {
|
||||
|
|
@ -1666,7 +1666,3 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 't
|
|||
NestedVisitorMap::OnlyBodies(self.cx.tcx.hir())
|
||||
}
|
||||
}
|
||||
|
||||
fn is_isize_or_usize(typ: Ty<'_>) -> bool {
|
||||
matches!(typ.kind(), ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue