Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics.rs')
| -rw-r--r-- | crates/hir/src/semantics.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 1f26d0c154..fdb94a6d5a 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs @@ -659,10 +659,8 @@ impl<'db> SemanticsImpl<'db> { // First expand into attribute invocations let containing_attribute_macro_call = self.with_ctx(|ctx| { token.parent_ancestors().filter_map(ast::Item::cast).find_map(|item| { - if item.attrs().next().is_none() { - // Don't force populate the dyn cache for items that don't have an attribute anyways - return None; - } + // Don't force populate the dyn cache for items that don't have an attribute anyways + item.attrs().next()?; Some(( ctx.item_to_macro_call(InFile::new(file_id, item.clone()))?, item, |