diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-20 19:09:12 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-20 19:09:12 +0100 |
commit | 9b94a2781357e1965e33e7ca48bdbcd35e9b8dff (patch) | |
tree | 1efcc01c43a7de8fdf996655732866a51da47f87 /crates/hir_def | |
parent | 79f50bd5836872a905274fd1d74316f466715032 (diff) | |
parent | 9ac5a90522ac54d492b5caec508023de4ca85858 (diff) |
Merge #8899
8899: minor: Simplify r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
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); |