Skip to content

Commit

Permalink
Don't emit missing_docs lint with dummy spans
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Sep 6, 2024
1 parent f6d2cfc commit ae661dd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,10 @@ impl MissingDoc {
let attrs = cx.tcx.hir().attrs(cx.tcx.local_def_id_to_hir_id(def_id));
let has_doc = attrs.iter().any(has_doc);
if !has_doc {
cx.emit_span_lint(
MISSING_DOCS,
cx.tcx.def_span(def_id),
BuiltinMissingDoc { article, desc },
);
let sp = cx.tcx.def_span(def_id);
if !sp.is_dummy() {
cx.emit_span_lint(MISSING_DOCS, sp, BuiltinMissingDoc { article, desc });
}
}
}
}
Expand Down

0 comments on commit ae661dd

Please sign in to comment.