diff options
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 2d1cba632..dfed729df 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -384,7 +384,7 @@ impl DefCollector<'_> { | |||
384 | if let MacroDirectiveKind::Attr { ast_id, mod_item, attr } = &directive.kind { | 384 | if let MacroDirectiveKind::Attr { ast_id, mod_item, attr } = &directive.kind { |
385 | self.ignore_attrs_on.insert(ast_id.ast_id.with_value(*mod_item), *attr); | 385 | self.ignore_attrs_on.insert(ast_id.ast_id.with_value(*mod_item), *attr); |
386 | 386 | ||
387 | let file_id = self.def_map[directive.module_id].definition_source(self.db).file_id; | 387 | let file_id = ast_id.ast_id.file_id; |
388 | let item_tree = self.db.file_item_tree(file_id); | 388 | let item_tree = self.db.file_item_tree(file_id); |
389 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); | 389 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); |
390 | ModCollector { | 390 | ModCollector { |
@@ -938,9 +938,7 @@ impl DefCollector<'_> { | |||
938 | 938 | ||
939 | // Resolved to derive helper. Collect the item's attributes again, | 939 | // Resolved to derive helper. Collect the item's attributes again, |
940 | // starting after the derive helper. | 940 | // starting after the derive helper. |
941 | let file_id = self.def_map[directive.module_id] | 941 | let file_id = ast_id.ast_id.file_id; |
942 | .definition_source(self.db) | ||
943 | .file_id; | ||
944 | let item_tree = self.db.file_item_tree(file_id); | 942 | let item_tree = self.db.file_item_tree(file_id); |
945 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); | 943 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); |
946 | self.ignore_attrs_on.insert(InFile::new(file_id, *mod_item), *attr); | 944 | self.ignore_attrs_on.insert(InFile::new(file_id, *mod_item), *attr); |