diff options
author | Jonas Schievink <[email protected]> | 2021-05-20 19:08:39 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-20 19:08:39 +0100 |
commit | 9ac5a90522ac54d492b5caec508023de4ca85858 (patch) | |
tree | 1efcc01c43a7de8fdf996655732866a51da47f87 /crates/hir_def | |
parent | 79f50bd5836872a905274fd1d74316f466715032 (diff) |
Simplify
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); |