diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index dfed729df..897b28e1a 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -100,7 +100,7 @@ pub(super) fn collect_defs( | |||
100 | proc_macros, | 100 | proc_macros, |
101 | exports_proc_macros: false, | 101 | exports_proc_macros: false, |
102 | from_glob_import: Default::default(), | 102 | from_glob_import: Default::default(), |
103 | ignore_attrs_on: Default::default(), | 103 | skip_attrs: Default::default(), |
104 | derive_helpers_in_scope: Default::default(), | 104 | derive_helpers_in_scope: Default::default(), |
105 | }; | 105 | }; |
106 | match block { | 106 | match block { |
@@ -253,7 +253,7 @@ struct DefCollector<'a> { | |||
253 | /// | 253 | /// |
254 | /// This also stores the attributes to skip when we resolve derive helpers and non-macro | 254 | /// This also stores the attributes to skip when we resolve derive helpers and non-macro |
255 | /// non-builtin attributes in general. | 255 | /// non-builtin attributes in general. |
256 | ignore_attrs_on: FxHashMap<InFile<ModItem>, AttrId>, | 256 | skip_attrs: FxHashMap<InFile<ModItem>, AttrId>, |
257 | /// Tracks which custom derives are in scope for an item, to allow resolution of derive helper | 257 | /// Tracks which custom derives are in scope for an item, to allow resolution of derive helper |
258 | /// attributes. | 258 | /// attributes. |
259 | derive_helpers_in_scope: FxHashMap<AstId<ast::Item>, Vec<Name>>, | 259 | derive_helpers_in_scope: FxHashMap<AstId<ast::Item>, Vec<Name>>, |
@@ -382,7 +382,7 @@ impl DefCollector<'_> { | |||
382 | let mut unresolved_macros = std::mem::replace(&mut self.unresolved_macros, Vec::new()); | 382 | let mut unresolved_macros = std::mem::replace(&mut self.unresolved_macros, Vec::new()); |
383 | let pos = unresolved_macros.iter().position(|directive| { | 383 | let pos = unresolved_macros.iter().position(|directive| { |
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.skip_attrs.insert(ast_id.ast_id.with_value(*mod_item), *attr); |
386 | 386 | ||
387 | let file_id = ast_id.ast_id.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); |
@@ -941,7 +941,7 @@ impl DefCollector<'_> { | |||
941 | let file_id = ast_id.ast_id.file_id; | 941 | let file_id = ast_id.ast_id.file_id; |
942 | let item_tree = self.db.file_item_tree(file_id); | 942 | let item_tree = self.db.file_item_tree(file_id); |
943 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); | 943 | let mod_dir = self.mod_dirs[&directive.module_id].clone(); |
944 | self.ignore_attrs_on.insert(InFile::new(file_id, *mod_item), *attr); | 944 | self.skip_attrs.insert(InFile::new(file_id, *mod_item), *attr); |
945 | ModCollector { | 945 | ModCollector { |
946 | def_collector: &mut *self, | 946 | def_collector: &mut *self, |
947 | macro_depth: directive.depth, | 947 | macro_depth: directive.depth, |
@@ -1504,7 +1504,7 @@ impl ModCollector<'_, '_> { | |||
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | let mut ignore_up_to = | 1506 | let mut ignore_up_to = |
1507 | self.def_collector.ignore_attrs_on.get(&InFile::new(self.file_id, mod_item)).copied(); | 1507 | self.def_collector.skip_attrs.get(&InFile::new(self.file_id, mod_item)).copied(); |
1508 | for attr in attrs.iter().skip_while(|attr| match ignore_up_to { | 1508 | for attr in attrs.iter().skip_while(|attr| match ignore_up_to { |
1509 | Some(id) if attr.id == id => { | 1509 | Some(id) if attr.id == id => { |
1510 | ignore_up_to = None; | 1510 | ignore_up_to = None; |
@@ -1779,7 +1779,7 @@ mod tests { | |||
1779 | proc_macros: Default::default(), | 1779 | proc_macros: Default::default(), |
1780 | exports_proc_macros: false, | 1780 | exports_proc_macros: false, |
1781 | from_glob_import: Default::default(), | 1781 | from_glob_import: Default::default(), |
1782 | ignore_attrs_on: Default::default(), | 1782 | skip_attrs: Default::default(), |
1783 | derive_helpers_in_scope: FxHashMap::default(), | 1783 | derive_helpers_in_scope: FxHashMap::default(), |
1784 | }; | 1784 | }; |
1785 | collector.seed_with_top_level(); | 1785 | collector.seed_with_top_level(); |