Skip to content

Commit fc0e65d

Browse files
authored
Use diagnostic item instead of path for core::fmt::Debug (rust-lang#13949)
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. Once this PR is merged and after the rustup, I will submit one to remove `LateContext::match_def_path()` from the compiler. changelog: none r? @flip1995
2 parents cccb006 + c9315bc commit fc0e65d

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)