Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/attr.rs')
| -rw-r--r-- | crates/hir-def/src/attr.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/hir-def/src/attr.rs b/crates/hir-def/src/attr.rs index 659ca2e958..3ff58814d1 100644 --- a/crates/hir-def/src/attr.rs +++ b/crates/hir-def/src/attr.rs @@ -273,7 +273,14 @@ impl Attrs { } pub fn is_test(&self) -> bool { - self.by_key("test").exists() + self.iter().any(|x| { + x.path() + .segments() + .iter() + .rev() + .zip(["core", "prelude", "v1", "test"].iter().rev()) + .all(|x| x.0.as_str() == Some(x.1)) + }) } pub fn is_ignore(&self) -> bool { |