From e5c5c0a040e0c74892ea0a36c7fd50e5410879bd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 Jan 2021 19:04:50 +0300 Subject: Include `countme` crate to count important data structures. --- crates/hir_def/src/item_tree.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/hir_def/src/item_tree.rs') diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index 1226d7d85..b8d7608e7 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs @@ -21,6 +21,7 @@ use hir_expand::{ HirFileId, InFile, }; use la_arena::{Arena, Idx, RawIdx}; +use profile::Count; use rustc_hash::FxHashMap; use smallvec::SmallVec; use syntax::{ast, match_ast}; @@ -67,6 +68,8 @@ impl GenericParamsId { /// The item tree of a source file. #[derive(Debug, Eq, PartialEq)] pub struct ItemTree { + _c: Count, + top_level: SmallVec<[ModItem; 1]>, attrs: FxHashMap, @@ -116,7 +119,12 @@ impl ItemTree { } fn empty() -> Self { - Self { top_level: Default::default(), attrs: Default::default(), data: Default::default() } + Self { + _c: Count::new(), + top_level: Default::default(), + attrs: Default::default(), + data: Default::default(), + } } fn shrink_to_fit(&mut self) { -- cgit v1.2.3