aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/resolver.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-09 18:11:18 +0000
committerGitHub <[email protected]>2021-03-09 18:11:18 +0000
commita436863364937633335bba8fe4fd81c8fdc33837 (patch)
treee2f4fc606210a3adaa9d43e58e822ac4d5cec988 /crates/hir_def/src/resolver.rs
parent9a5c72d9f07760fe875ef653a956fcaa1fe5d0de (diff)
parentb885e6bdeeb1023df53b3f292cfe301448eeaeef (diff)
Merge #7948
7948: Delete `ContainerId` r=jonas-schievink a=jonas-schievink Since block expressions containing items now have a `ModuleId`, there's no need to also treat `DefWithBodyId` as a potential item container. Since https://github.com/rust-analyzer/rust-analyzer/pull/7878, only the `ModuleId` variant of `ContainerId` was ever created, so just delete the thing and use `ModuleId` everywhere. bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/resolver.rs')
-rw-r--r--crates/hir_def/src/resolver.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index 6f036c8c4..42736171e 100644
--- a/crates/hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -19,10 +19,10 @@ use crate::{
19 path::{ModPath, PathKind}, 19 path::{ModPath, PathKind},
20 per_ns::PerNs, 20 per_ns::PerNs,
21 visibility::{RawVisibility, Visibility}, 21 visibility::{RawVisibility, Visibility},
22 AdtId, AssocContainerId, ConstId, ConstParamId, ContainerId, DefWithBodyId, EnumId, 22 AdtId, AssocContainerId, ConstId, ConstParamId, DefWithBodyId, EnumId, EnumVariantId,
23 EnumVariantId, FunctionId, GenericDefId, GenericParamId, HasModule, ImplId, LifetimeParamId, 23 FunctionId, GenericDefId, GenericParamId, HasModule, ImplId, LifetimeParamId, LocalModuleId,
24 LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, StructId, TraitId, TypeAliasId, 24 Lookup, ModuleDefId, ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId,
25 TypeParamId, VariantId, 25 VariantId,
26}; 26};
27 27
28#[derive(Debug, Clone, Default)] 28#[derive(Debug, Clone, Default)]
@@ -688,15 +688,6 @@ impl HasResolver for DefWithBodyId {
688 } 688 }
689} 689}
690 690
691impl HasResolver for ContainerId {
692 fn resolver(self, db: &dyn DefDatabase) -> Resolver {
693 match self {
694 ContainerId::ModuleId(it) => it.resolver(db),
695 ContainerId::DefWithBodyId(it) => it.module(db).resolver(db),
696 }
697 }
698}
699
700impl HasResolver for AssocContainerId { 691impl HasResolver for AssocContainerId {
701 fn resolver(self, db: &dyn DefDatabase) -> Resolver { 692 fn resolver(self, db: &dyn DefDatabase) -> Resolver {
702 match self { 693 match self {