Skip to content

Commit 55d4f76

Browse files
authored
Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, r=lolbinarycat
[rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion Fixes rust-lang/rust#141553. The problem was that we change the context for the attributes in some cases to get better error output, preventing us to detect if the attribute comes from expansion. Most of the changes are about keeping track of the "does this span comes from expansion" information. r? ```@Manishearth```
2 parents 708ffd5 + 7a6f7bc commit 55d4f76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/doc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,8 @@ impl Fragments<'_> {
765765
/// get the span for the markdown range. Note that this function is not cheap, use it with
766766
/// caution.
767767
#[must_use]
768-
fn span(&self, cx: &LateContext<'_>, range: Range<usize>) -> Option<Span> {
769-
source_span_for_markdown_range(cx.tcx, self.doc, &range, self.fragments)
768+
fn span(self, cx: &LateContext<'_>, range: Range<usize>) -> Option<Span> {
769+
source_span_for_markdown_range(cx.tcx, self.doc, &range, self.fragments).map(|(sp, _)| sp)
770770
}
771771
}
772772

0 commit comments

Comments
 (0)