diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-22 19:03:38 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-22 19:03:38 +0100 |
commit | 9239943b84ec2bd687c4c80d2c3a0df4f8caf31c (patch) | |
tree | 0176dc6c74ba31b3540d7063b70b2fedddd8cadd /crates/hir_def | |
parent | 0e0d77d0a3361ee08cdb08a9060f5aa6160a5741 (diff) | |
parent | 260a24d05e8392da4ab5eb3ebe45de81d4f72f50 (diff) |
Merge #9377
9377: internal: count ItemScopes r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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, |