From 260a24d05e8392da4ab5eb3ebe45de81d4f72f50 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 22 Jun 2021 21:02:08 +0300 Subject: internal: count ItemScopes --- crates/hir_def/src/item_scope.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir_def') 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; use base_db::CrateId; use hir_expand::{name::Name, AstId, MacroCallId, MacroDefKind}; use once_cell::sync::Lazy; +use profile::Count; use rustc_hash::{FxHashMap, FxHashSet}; use stdx::format_to; use syntax::ast; @@ -30,6 +31,8 @@ pub struct PerNsGlobImports { #[derive(Debug, Default, PartialEq, Eq)] pub struct ItemScope { + _c: Count, + /// Defs visible in this scope. This includes `declarations`, but also /// imports. types: FxHashMap, @@ -311,6 +314,7 @@ impl ItemScope { pub(crate) fn shrink_to_fit(&mut self) { // Exhaustive match to require handling new fields. let Self { + _c: _, types, values, macros, -- cgit v1.2.3