From 88ed33c21b921ee2ce2acfff1c4af4b303e878a4 Mon Sep 17 00:00:00 2001 From: Samuel Moelius <35515885+smoelius@users.noreply.github.com> Date: Wed, 13 Oct 2021 07:25:29 -0400 Subject: [PATCH] Update clippy_lints/src/format_args.rs Co-authored-by: Cameron Steffen --- clippy_lints/src/format_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/format_args.rs b/clippy_lints/src/format_args.rs index 88ac1e877271..9ccc1f699c84 100644 --- a/clippy_lints/src/format_args.rs +++ b/clippy_lints/src/format_args.rs @@ -140,7 +140,7 @@ fn check_to_string_in_format_args<'tcx>(cx: &LateContext<'tcx>, name: Symbol, ar if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(value.hir_id); if is_diag_trait_item(cx, method_def_id, sym::ToString); let receiver_ty = cx.typeck_results().expr_ty(receiver); - if let Some(display_trait_id) = get_trait_def_id(cx, &paths::DISPLAY_TRAIT); + if let Some(display_trait_id) = cx.tcx.get_diagnostic_item(sym::Display); if let Some(value_snippet) = snippet_opt(cx, value.span); if let Some(dot) = value_snippet.rfind('.'); if let Some(receiver_snippet) = snippet_opt(cx, receiver.span);