Skip to content

Commit 21890f5

Browse files
committed
Auto merge of #142864 - jhpratt:rollup-mf0yq8o, r=jhpratt
Rollup of 10 pull requests Successful merges: - rust-lang/rust#140254 (Pass -Cpanic=abort for the panic_abort crate) - rust-lang/rust#142600 (Port `#[rustc_pub_transparent]` to the new attribute system) - rust-lang/rust#142617 (improve search graph docs, reset `encountered_overflow` between reruns) - rust-lang/rust#142747 (rustdoc_json: conversion cleanups) - rust-lang/rust#142776 (All HIR attributes are outer) - rust-lang/rust#142800 (integer docs: remove extraneous text) - rust-lang/rust#142841 (Enable fmt-write-bloat for Windows) - rust-lang/rust#142845 (Enable textrel-on-minimal-lib for Windows) - rust-lang/rust#142850 (remove asm_goto feature annotation, for it is now stabilized) - rust-lang/rust#142860 (Notify me on tidy changes) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e72406e + a1439ed commit 21890f5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

clippy_lints/src/doc/doc_suspicious_footnotes.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
2+
use rustc_ast::attr::AttributeExt as _;
23
use rustc_ast::token::CommentKind;
34
use rustc_errors::Applicability;
45
use rustc_hir::{AttrStyle, Attribute};
@@ -43,13 +44,19 @@ pub fn check(cx: &LateContext<'_>, doc: &str, range: Range<usize>, fragments: &F
4344
"looks like a footnote ref, but has no matching footnote",
4445
|diag| {
4546
if this_fragment.kind == DocFragmentKind::SugaredDoc {
46-
let (doc_attr, (_, doc_attr_comment_kind)) = attrs
47+
let (doc_attr, (_, doc_attr_comment_kind), attr_style) = attrs
4748
.iter()
4849
.filter(|attr| attr.span().overlaps(this_fragment.span))
4950
.rev()
50-
.find_map(|attr| Some((attr, attr.doc_str_and_comment_kind()?)))
51+
.find_map(|attr| {
52+
Some((
53+
attr,
54+
attr.doc_str_and_comment_kind()?,
55+
attr.doc_resolution_scope()?,
56+
))
57+
})
5158
.unwrap();
52-
let (to_add, terminator) = match (doc_attr_comment_kind, doc_attr.style()) {
59+
let (to_add, terminator) = match (doc_attr_comment_kind, attr_style) {
5360
(CommentKind::Line, AttrStyle::Outer) => ("\n///\n/// ", ""),
5461
(CommentKind::Line, AttrStyle::Inner) => ("\n//!\n//! ", ""),
5562
(CommentKind::Block, AttrStyle::Outer) => ("\n/** ", " */"),

0 commit comments

Comments
 (0)