Skip to content

Commit 50c692c

Browse files
Update clippy source code to make use of TyCtxt::def_descr instead of ItemKind::descr
1 parent 022c914 commit 50c692c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tools/clippy/clippy_lints/src/undocumented_unsafe_blocks.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ impl<'tcx> LateLintPass<'tcx> for UndocumentedUnsafeBlocks {
256256
cx,
257257
UNNECESSARY_SAFETY_COMMENT,
258258
span,
259-
format!("{} has unnecessary safety comment", item.kind.descr()),
259+
format!(
260+
"{} has unnecessary safety comment",
261+
cx.tcx.def_descr(item.owner_id.to_def_id()),
262+
),
260263
|diag| {
261264
diag.span_help(help_span, "consider removing the safety comment");
262265
},
@@ -274,7 +277,10 @@ impl<'tcx> LateLintPass<'tcx> for UndocumentedUnsafeBlocks {
274277
cx,
275278
UNNECESSARY_SAFETY_COMMENT,
276279
span,
277-
format!("{} has unnecessary safety comment", item.kind.descr()),
280+
format!(
281+
"{} has unnecessary safety comment",
282+
cx.tcx.def_descr(item.owner_id.to_def_id()),
283+
),
278284
|diag| {
279285
diag.span_help(help_span, "consider removing the safety comment");
280286
},

0 commit comments

Comments
 (0)