about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAda Alakbarova <ada.alakbarova@proton.me>2025-08-21 00:01:10 +0200
committerAda Alakbarova <ada.alakbarova@proton.me>2025-08-22 15:03:15 +0200
commit81b4de649fd7795b99cdf6a77f0b5c49cfc778b3 (patch)
treeda9c3fab9c4ee0982adfb484cfa0be6aedcc2a17
parentf51b5afd5043c5514c0eccd9e8083694bfea967b (diff)
downloadrust-81b4de649fd7795b99cdf6a77f0b5c49cfc778b3.tar.gz
rust-81b4de649fd7795b99cdf6a77f0b5c49cfc778b3.zip
is_default_equivalent_ctor: store name in a var
-rw-r--r--clippy_utils/src/lib.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 7a2c1bf40d9..3776a34ce33 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -641,9 +641,7 @@ fn is_default_equivalent_ctor(cx: &LateContext<'_>, def_id: DefId, path: &QPath<
         && let Some(adt) = cx.tcx.type_of(impl_did).instantiate_identity().ty_adt_def()
     {
         return Some(adt.did()) == cx.tcx.lang_items().string()
-            || std_types_symbols
-                .iter()
-                .any(|&symbol| cx.tcx.is_diagnostic_item(symbol, adt.did()));
+            || (cx.tcx.get_diagnostic_name(adt.did())).is_some_and(|adt_name| std_types_symbols.contains(&adt_name));
     }
     false
 }