aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-17 09:59:04 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-17 09:59:04 +0000
commit7d3f48cdaf20d718e711f999573adf3303e9396a (patch)
treedf584fbb044cad23e196da5ae0b3636b06bfeeff /crates/ra_hir/src/ty
parent65e763fa84ae70ec9cee13f434acaae5371ad8e5 (diff)
parent3a770233652cbf3e48688dd5f1d9f3c363eda5a8 (diff)
Merge #968
968: Macro aware name resoltion r=matklad a=matklad The first commit lays the ground work for new name resolution, including * extracting position-indendent items from parse trees * walking the tree of modules * old-style macro_rules resolve cc @pnkfelix: this looks like an API name resolution should interact with. Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index 94b757af2..804824868 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -7,10 +7,12 @@ use std::sync::Arc;
7use rustc_hash::FxHashMap; 7use rustc_hash::FxHashMap;
8 8
9use crate::{ 9use crate::{
10 HirDatabase, module_tree::ModuleId, Module, Crate, Name, Function, Trait, 10 HirDatabase, Module, Crate, Name, Function, Trait,
11 ids::TraitId, 11 ids::TraitId,
12 impl_block::{ImplId, ImplBlock, ImplItem}, 12 impl_block::{ImplId, ImplBlock, ImplItem},
13 ty::{AdtDef, Ty}, 13 ty::{AdtDef, Ty},
14 nameres::CrateModuleId,
15
14}; 16};
15 17
16/// This is used as a key for indexing impls. 18/// This is used as a key for indexing impls.
@@ -33,10 +35,10 @@ impl TyFingerprint {
33 35
34#[derive(Debug, PartialEq, Eq)] 36#[derive(Debug, PartialEq, Eq)]
35pub struct CrateImplBlocks { 37pub struct CrateImplBlocks {
36 /// To make sense of the ModuleIds, we need the source root. 38 /// To make sense of the CrateModuleIds, we need the source root.
37 krate: Crate, 39 krate: Crate,
38 impls: FxHashMap<TyFingerprint, Vec<(ModuleId, ImplId)>>, 40 impls: FxHashMap<TyFingerprint, Vec<(CrateModuleId, ImplId)>>,
39 impls_by_trait: FxHashMap<TraitId, Vec<(ModuleId, ImplId)>>, 41 impls_by_trait: FxHashMap<TraitId, Vec<(CrateModuleId, ImplId)>>,
40} 42}
41 43
42impl CrateImplBlocks { 44impl CrateImplBlocks {