]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/keys.rs
Merge #11461
[rust.git] / crates / hir_def / src / keys.rs
index 93c92c1b9c94f347e51b9884ac5e3606b0d7ea09..8cd2d771721493061b0f6acec96dfa7c9a820dc8 100644 (file)
@@ -34,7 +34,8 @@
 
 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 @@ fn get<'a>(map: &'a DynMap, key: &AST) -> Option<&'a 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())
+    }
 }