From 5f89a60f1a0feab1e2e0dd37e642877552675da4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 19 Apr 2021 17:11:49 +0300 Subject: fix: false positive about inner attrs in docs closes #8541 --- crates/hir_def/src/attr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_def') 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( _ => return None, } }; - let attrs = attrs.filter(|attr| attr.excl_token().is_some()); + let attrs = attrs.filter(|attr| attr.kind().is_inner()); let docs = docs.filter(|doc| doc.is_inner()); Some((attrs, docs)) } @@ -740,7 +740,7 @@ fn collect_attrs( let (inner_attrs, inner_docs) = inner_attributes(owner.syntax()) .map_or((None, None), |(attrs, docs)| (Some(attrs), Some(docs))); - let outer_attrs = owner.attrs().filter(|attr| attr.excl_token().is_none()); + let outer_attrs = owner.attrs().filter(|attr| attr.kind().is_outer()); let attrs = outer_attrs .chain(inner_attrs.into_iter().flatten()) .map(|attr| (attr.syntax().text_range().start(), Either::Left(attr))); -- cgit v1.2.3