mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Merge #8578
8578: fix: false positive about inner attrs in docs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
6877e6e4da
6 changed files with 238 additions and 182 deletions
|
@ -125,6 +125,18 @@ pub enum AttrKind {
|
|||
Outer,
|
||||
}
|
||||
|
||||
impl AttrKind {
|
||||
/// Returns `true` if the attr_kind is [`Inner`].
|
||||
pub fn is_inner(&self) -> bool {
|
||||
matches!(self, Self::Inner)
|
||||
}
|
||||
|
||||
/// Returns `true` if the attr_kind is [`Outer`].
|
||||
pub fn is_outer(&self) -> bool {
|
||||
matches!(self, Self::Outer)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::Attr {
|
||||
pub fn as_simple_atom(&self) -> Option<SmolStr> {
|
||||
if self.eq_token().is_some() || self.token_tree().is_some() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue