diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-19 15:37:54 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-19 15:37:54 +0100 |
commit | 6877e6e4da08570ca4fa245306ebc6725e861ab5 (patch) | |
tree | 40900502c52e16ad54cf558255a4acce539541a4 /crates/hir_def/src | |
parent | 6991b517f2c1ba9eb75f98ca689378e8dfa1e87f (diff) | |
parent | 5f89a60f1a0feab1e2e0dd37e642877552675da4 (diff) |
Merge #8578
8578: fix: false positive about inner attrs in docs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/attr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 786fad6e1..d9294d93a 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
@@ -545,7 +545,7 @@ fn inner_attributes( | |||
545 | _ => return None, | 545 | _ => return None, |
546 | } | 546 | } |
547 | }; | 547 | }; |
548 | let attrs = attrs.filter(|attr| attr.excl_token().is_some()); | 548 | let attrs = attrs.filter(|attr| attr.kind().is_inner()); |
549 | let docs = docs.filter(|doc| doc.is_inner()); | 549 | let docs = docs.filter(|doc| doc.is_inner()); |
550 | Some((attrs, docs)) | 550 | Some((attrs, docs)) |
551 | } | 551 | } |
@@ -740,7 +740,7 @@ fn collect_attrs( | |||
740 | let (inner_attrs, inner_docs) = inner_attributes(owner.syntax()) | 740 | let (inner_attrs, inner_docs) = inner_attributes(owner.syntax()) |
741 | .map_or((None, None), |(attrs, docs)| (Some(attrs), Some(docs))); | 741 | .map_or((None, None), |(attrs, docs)| (Some(attrs), Some(docs))); |
742 | 742 | ||
743 | let outer_attrs = owner.attrs().filter(|attr| attr.excl_token().is_none()); | 743 | let outer_attrs = owner.attrs().filter(|attr| attr.kind().is_outer()); |
744 | let attrs = outer_attrs | 744 | let attrs = outer_attrs |
745 | .chain(inner_attrs.into_iter().flatten()) | 745 | .chain(inner_attrs.into_iter().flatten()) |
746 | .map(|attr| (attr.syntax().text_range().start(), Either::Left(attr))); | 746 | .map(|attr| (attr.syntax().text_range().start(), Either::Left(attr))); |