- if cx.tcx.lang_items().drop_trait() == def_id
- && let Some(needs_drop) = cx.tcx.get_diagnostic_item(sym::needs_drop)
- {
- cx.struct_span_lint(DYN_DROP, bound.span, fluent::lint_drop_glue, |lint| {
- lint.set_arg("needs_drop", cx.tcx.def_path_str(needs_drop))
- });
+ if cx.tcx.lang_items().drop_trait() == def_id {
+ let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else {
+ return
+ };
+ cx.emit_spanned_lint(DYN_DROP, bound.span, DropGlue { tcx: cx.tcx, def_id });