Skip to content

Commit 81b4de6

Browse files
committed
is_default_equivalent_ctor: store name in a var
1 parent f51b5af commit 81b4de6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clippy_utils/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,7 @@ fn is_default_equivalent_ctor(cx: &LateContext<'_>, def_id: DefId, path: &QPath<
641641
&& let Some(adt) = cx.tcx.type_of(impl_did).instantiate_identity().ty_adt_def()
642642
{
643643
return Some(adt.did()) == cx.tcx.lang_items().string()
644-
|| std_types_symbols
645-
.iter()
646-
.any(|&symbol| cx.tcx.is_diagnostic_item(symbol, adt.did()));
644+
|| (cx.tcx.get_diagnostic_name(adt.did())).is_some_and(|adt_name| std_types_symbols.contains(&adt_name));
647645
}
648646
false
649647
}

0 commit comments

Comments
 (0)