diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 36ef615a3..e962bbd31 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -63,7 +63,7 @@ use test_utils::tested_by; | |||
63 | use crate::{ | 63 | use crate::{ |
64 | ModuleDef, Name, Crate, Module, SourceItemId, | 64 | ModuleDef, Name, Crate, Module, SourceItemId, |
65 | DefDatabase, Path, PathKind, HirFileId, Trait, | 65 | DefDatabase, Path, PathKind, HirFileId, Trait, |
66 | ids::{MacroCallId, MacroDefId}, | 66 | ids::MacroDefId, |
67 | diagnostics::DiagnosticSink, | 67 | diagnostics::DiagnosticSink, |
68 | nameres::diagnostics::DefDiagnostic, | 68 | nameres::diagnostics::DefDiagnostic, |
69 | }; | 69 | }; |
@@ -84,9 +84,7 @@ pub struct CrateDefMap { | |||
84 | extern_prelude: FxHashMap<Name, ModuleDef>, | 84 | extern_prelude: FxHashMap<Name, ModuleDef>, |
85 | root: CrateModuleId, | 85 | root: CrateModuleId, |
86 | modules: Arena<CrateModuleId, ModuleData>, | 86 | modules: Arena<CrateModuleId, ModuleData>, |
87 | macros: Arena<CrateMacroId, mbe::MacroRules>, | ||
88 | public_macros: FxHashMap<Name, MacroDefId>, | 87 | public_macros: FxHashMap<Name, MacroDefId>, |
89 | macro_resolutions: FxHashMap<MacroCallId, (Crate, CrateMacroId)>, | ||
90 | diagnostics: Vec<DefDiagnostic>, | 88 | diagnostics: Vec<DefDiagnostic>, |
91 | } | 89 | } |
92 | 90 | ||
@@ -97,18 +95,6 @@ impl std::ops::Index<CrateModuleId> for CrateDefMap { | |||
97 | } | 95 | } |
98 | } | 96 | } |
99 | 97 | ||
100 | impl std::ops::Index<CrateMacroId> for CrateDefMap { | ||
101 | type Output = mbe::MacroRules; | ||
102 | fn index(&self, id: CrateMacroId) -> &mbe::MacroRules { | ||
103 | &self.macros[id] | ||
104 | } | ||
105 | } | ||
106 | |||
107 | /// An ID of a macro, **local** to a specific crate | ||
108 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
109 | pub(crate) struct CrateMacroId(RawId); | ||
110 | impl_arena_id!(CrateMacroId); | ||
111 | |||
112 | /// An ID of a module, **local** to a specific crate | 98 | /// An ID of a module, **local** to a specific crate |
113 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 99 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
114 | pub(crate) struct CrateModuleId(RawId); | 100 | pub(crate) struct CrateModuleId(RawId); |
@@ -202,9 +188,7 @@ impl CrateDefMap { | |||
202 | prelude: None, | 188 | prelude: None, |
203 | root, | 189 | root, |
204 | modules, | 190 | modules, |
205 | macros: Arena::default(), | ||
206 | public_macros: FxHashMap::default(), | 191 | public_macros: FxHashMap::default(), |
207 | macro_resolutions: FxHashMap::default(), | ||
208 | diagnostics: Vec::new(), | 192 | diagnostics: Vec::new(), |
209 | } | 193 | } |
210 | }; | 194 | }; |