aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-22 19:02:08 +0100
committerAleksey Kladov <[email protected]>2021-06-22 19:02:08 +0100
commit260a24d05e8392da4ab5eb3ebe45de81d4f72f50 (patch)
tree0176dc6c74ba31b3540d7063b70b2fedddd8cadd
parent4772cb6b301917820eff62d36e2d6ec359420df3 (diff)
internal: count ItemScopes
-rw-r--r--crates/hir_def/src/item_scope.rs4
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;
6use base_db::CrateId; 6use base_db::CrateId;
7use hir_expand::{name::Name, AstId, MacroCallId, MacroDefKind}; 7use hir_expand::{name::Name, AstId, MacroCallId, MacroDefKind};
8use once_cell::sync::Lazy; 8use once_cell::sync::Lazy;
9use profile::Count;
9use rustc_hash::{FxHashMap, FxHashSet}; 10use rustc_hash::{FxHashMap, FxHashSet};
10use stdx::format_to; 11use stdx::format_to;
11use syntax::ast; 12use syntax::ast;
@@ -30,6 +31,8 @@ pub struct PerNsGlobImports {
30 31
31#[derive(Debug, Default, PartialEq, Eq)] 32#[derive(Debug, Default, PartialEq, Eq)]
32pub struct ItemScope { 33pub 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,