Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/collector.rs')
-rw-r--r--crates/hir-def/src/nameres/collector.rs18
1 files changed, 5 insertions, 13 deletions
diff --git a/crates/hir-def/src/nameres/collector.rs b/crates/hir-def/src/nameres/collector.rs
index 6de967c2c6..2fae253d0a 100644
--- a/crates/hir-def/src/nameres/collector.rs
+++ b/crates/hir-def/src/nameres/collector.rs
@@ -37,9 +37,7 @@ use crate::{
},
macro_call_as_call_id, macro_call_as_call_id_with_eager,
nameres::{
- attr_resolution::{
- attr_macro_as_call_id, derive_attr_macro_as_call_id, derive_macro_as_call_id,
- },
+ attr_resolution::{attr_macro_as_call_id, derive_macro_as_call_id},
diagnostics::DefDiagnostic,
mod_resolution::ModDir,
path_resolution::ReachedFixedPoint,
@@ -1234,7 +1232,8 @@ impl DefCollector<'_> {
Some(def) if def.is_attribute() => def,
_ => return Resolved::No,
};
-
+ let call_id =
+ attr_macro_as_call_id(self.db, file_ast_id, attr, self.def_map.krate, def);
if let MacroDefId {
kind:
MacroDefKind::BuiltInAttr(
@@ -1266,13 +1265,7 @@ impl DefCollector<'_> {
let ast_id = ast_id.with_value(ast_adt_id);
// the call_id for the actual derive macro. This is used so all the derive proc macros can share a token tree
- let call_id = derive_attr_macro_as_call_id(
- self.db,
- &ast_id,
- attr,
- self.def_map.krate,
- def,
- );
+
match attr.parse_path_comma_token_tree(self.db.upcast()) {
Some(derive_macros) => {
let mut len = 0;
@@ -1320,8 +1313,7 @@ impl DefCollector<'_> {
return recollect_without(self);
}
- let call_id =
- attr_macro_as_call_id(self.db, file_ast_id, attr, self.def_map.krate, def);
+
// Skip #[test]/#[bench] expansion, which would merely result in more memory usage
// due to duplicating functions into macro expansions
if matches!(