diff options
author | Aleksey Kladov <[email protected]> | 2021-06-22 19:02:08 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-22 19:02:08 +0100 |
commit | 260a24d05e8392da4ab5eb3ebe45de81d4f72f50 (patch) | |
tree | 0176dc6c74ba31b3540d7063b70b2fedddd8cadd /crates/hir_def | |
parent | 4772cb6b301917820eff62d36e2d6ec359420df3 (diff) |
internal: count ItemScopes
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/item_scope.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs index 1b7cb7c8b..0d364b1cb 100644 --- a/crates/hir_def/src/item_scope.rs +++ b/crates/hir_def/src/item_scope.rs | |||
@@ -6,6 +6,7 @@ use std::collections::hash_map::Entry; | |||
6 | use base_db::CrateId; | 6 | use base_db::CrateId; |
7 | use hir_expand::{name::Name, AstId, MacroCallId, MacroDefKind}; | 7 | use hir_expand::{name::Name, AstId, MacroCallId, MacroDefKind}; |
8 | use once_cell::sync::Lazy; | 8 | use once_cell::sync::Lazy; |
9 | use profile::Count; | ||
9 | use rustc_hash::{FxHashMap, FxHashSet}; | 10 | use rustc_hash::{FxHashMap, FxHashSet}; |
10 | use stdx::format_to; | 11 | use stdx::format_to; |
11 | use syntax::ast; | 12 | use syntax::ast; |
@@ -30,6 +31,8 @@ pub struct PerNsGlobImports { | |||
30 | 31 | ||
31 | #[derive(Debug, Default, PartialEq, Eq)] | 32 | #[derive(Debug, Default, PartialEq, Eq)] |
32 | pub struct ItemScope { | 33 | pub struct ItemScope { |
34 | _c: Count<Self>, | ||
35 | |||
33 | /// Defs visible in this scope. This includes `declarations`, but also | 36 | /// Defs visible in this scope. This includes `declarations`, but also |
34 | /// imports. | 37 | /// imports. |
35 | types: FxHashMap<Name, (ModuleDefId, Visibility)>, | 38 | types: FxHashMap<Name, (ModuleDefId, Visibility)>, |
@@ -311,6 +314,7 @@ impl ItemScope { | |||
311 | pub(crate) fn shrink_to_fit(&mut self) { | 314 | pub(crate) fn shrink_to_fit(&mut self) { |
312 | // Exhaustive match to require handling new fields. | 315 | // Exhaustive match to require handling new fields. |
313 | let Self { | 316 | let Self { |
317 | _c: _, | ||
314 | types, | 318 | types, |
315 | values, | 319 | values, |
316 | macros, | 320 | macros, |