aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/macros.rs')
-rw-r--r--crates/ra_hir/src/macros.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_hir/src/macros.rs b/crates/ra_hir/src/macros.rs
index f0b99cc1a..d9de2d8bd 100644
--- a/crates/ra_hir/src/macros.rs
+++ b/crates/ra_hir/src/macros.rs
@@ -11,31 +11,31 @@ use crate::{SourceRootId, module::ModuleId, SourceItemId, HirDatabase};
11/// Def's are a core concept of hir. A `Def` is an Item (function, module, etc) 11/// Def's are a core concept of hir. A `Def` is an Item (function, module, etc)
12/// in a specific module. 12/// in a specific module.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
14pub struct MacroInvocationId(u32); 14pub struct MacroCallId(u32);
15ra_db::impl_numeric_id!(MacroInvocationId); 15ra_db::impl_numeric_id!(MacroCallId);
16 16
17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
18pub struct MacroInvocationLoc { 18pub struct MacroCallLoc {
19 source_root_id: SourceRootId, 19 source_root_id: SourceRootId,
20 module_id: ModuleId, 20 module_id: ModuleId,
21 source_item_id: SourceItemId, 21 source_item_id: SourceItemId,
22} 22}
23 23
24impl MacroInvocationId { 24impl MacroCallId {
25 pub(crate) fn loc( 25 pub(crate) fn loc(
26 self, 26 self,
27 db: &impl AsRef<LocationIntener<MacroInvocationLoc, MacroInvocationId>>, 27 db: &impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>>,
28 ) -> MacroInvocationLoc { 28 ) -> MacroCallLoc {
29 db.as_ref().id2loc(self) 29 db.as_ref().id2loc(self)
30 } 30 }
31} 31}
32 32
33impl MacroInvocationLoc { 33impl MacroCallLoc {
34 #[allow(unused)] 34 #[allow(unused)]
35 pub(crate) fn id( 35 pub(crate) fn id(
36 &self, 36 &self,
37 db: &impl AsRef<LocationIntener<MacroInvocationLoc, MacroInvocationId>>, 37 db: &impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>>,
38 ) -> MacroInvocationId { 38 ) -> MacroCallId {
39 db.as_ref().loc2id(&self) 39 db.as_ref().loc2id(&self)
40 } 40 }
41} 41}
@@ -150,7 +150,7 @@ impl MacroExpansion {
150 150
151pub(crate) fn expand_macro_invocation( 151pub(crate) fn expand_macro_invocation(
152 db: &impl HirDatabase, 152 db: &impl HirDatabase,
153 invoc: MacroInvocationId, 153 invoc: MacroCallId,
154) -> Option<Arc<MacroExpansion>> { 154) -> Option<Arc<MacroExpansion>> {
155 let loc = invoc.loc(db); 155 let loc = invoc.loc(db);
156 let syntax = db.file_item(loc.source_item_id); 156 let syntax = db.file_item(loc.source_item_id);