Skip to content

Commit ed46141

Browse files
committed
Remove duplicate type_diagnostic_name function
1 parent 4f66130 commit ed46141

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

clippy_lints/src/eta_reduction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
22
use clippy_utils::higher::VecArgs;
33
use clippy_utils::source::snippet_opt;
4-
use clippy_utils::ty::type_diagnostic_name;
4+
use clippy_utils::ty::get_type_diagnostic_name;
55
use clippy_utils::usage::{local_used_after_expr, local_used_in};
66
use clippy_utils::{get_path_from_caller_to_method_type, is_adjusted, path_to_local, path_to_local_id};
77
use rustc_errors::Applicability;
@@ -139,7 +139,7 @@ fn check_clousure<'tcx>(cx: &LateContext<'tcx>, outer_receiver: Option<&Expr<'tc
139139
{
140140
let callee_ty_raw = typeck.expr_ty(callee);
141141
let callee_ty = callee_ty_raw.peel_refs();
142-
if matches!(type_diagnostic_name(cx, callee_ty), Some(sym::Arc | sym::Rc))
142+
if matches!(get_type_diagnostic_name(cx, callee_ty), Some(sym::Arc | sym::Rc))
143143
|| !check_inputs(typeck, body.params, None, args)
144144
{
145145
return;

clippy_utils/src/ty.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,6 @@ pub fn is_type_lang_item(cx: &LateContext<'_>, ty: Ty<'_>, lang_item: LangItem)
455455
}
456456
}
457457

458-
/// Gets the diagnostic name of the type, if it has one
459-
pub fn type_diagnostic_name(cx: &LateContext<'_>, ty: Ty<'_>) -> Option<Symbol> {
460-
ty.ty_adt_def().and_then(|adt| cx.tcx.get_diagnostic_name(adt.did()))
461-
}
462-
463458
/// Return `true` if the passed `typ` is `isize` or `usize`.
464459
pub fn is_isize_or_usize(typ: Ty<'_>) -> bool {
465460
matches!(typ.kind(), ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize))

0 commit comments

Comments
 (0)