Skip to content

Commit c9315bc

Browse files
committed
Use diagnostic item instead of path for core::fmt::Debug
This removes the last call to `LateContext::match_def_path()` in Clippy's code. The `LateContext::match_def_path()` in the compiler sources was only kept for Clippy's usage.
1 parent ad69c65 commit c9315bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/missing_fields_in_debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingFieldsInDebug {
207207
// this prevents ICEs such as when self is a type parameter or a primitive type
208208
// (see #10887, #11063)
209209
&& let Res::Def(DefKind::Struct | DefKind::Enum | DefKind::Union, self_path_did) = self_path.res
210-
&& cx.match_def_path(trait_def_id, &[sym::core, sym::fmt, sym::Debug])
210+
&& cx.tcx.is_diagnostic_item(sym::Debug, trait_def_id)
211211
// don't trigger if this impl was derived
212212
&& !cx.tcx.has_attr(item.owner_id, sym::automatically_derived)
213213
&& !item.span.from_expansion()

0 commit comments

Comments
 (0)