Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/keys.rs')
| -rw-r--r-- | crates/hir_def/src/keys.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir_def/src/keys.rs b/crates/hir_def/src/keys.rs index 93c92c1b9c..8cd2d77172 100644 --- a/crates/hir_def/src/keys.rs +++ b/crates/hir_def/src/keys.rs @@ -34,7 +34,8 @@ pub const CONST_PARAM: Key<ast::ConstParam, ConstParamId> = Key::new(); pub const MACRO: Key<ast::Macro, MacroDefId> = Key::new(); pub const ATTR_MACRO_CALL: Key<ast::Item, MacroCallId> = Key::new(); -pub const DERIVE_MACRO_CALL: Key<ast::Attr, (AttrId, Box<[Option<MacroCallId>]>)> = Key::new(); +pub const DERIVE_MACRO_CALL: Key<ast::Attr, (AttrId, MacroCallId, Box<[Option<MacroCallId>]>)> = + Key::new(); /// XXX: AST Nodes and SyntaxNodes have identity equality semantics: nodes are /// equal if they point to exactly the same object. @@ -60,4 +61,7 @@ impl<AST: AstNode + 'static, ID: 'static> Policy for AstPtrPolicy<AST, ID> { let key = AstPtr::new(key); map.map.get::<FxHashMap<AstPtr<AST>, ID>>()?.get(&key) } + fn is_empty(map: &DynMap) -> bool { + map.map.get::<FxHashMap<AstPtr<AST>, ID>>().map_or(true, |it| it.is_empty()) + } } |