diff options
author | Aleksey Kladov <[email protected]> | 2018-12-04 20:44:00 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-04 20:44:00 +0000 |
commit | d8b0379e1063941331253905795699a918233ef9 (patch) | |
tree | 18a7ef94cdf6575ed1954648287b284c3ace6451 /crates/ra_hir/src/mock.rs | |
parent | 947e3350e045aab1db9b232542425a3faa856907 (diff) |
Add functions to DefId
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r-- | crates/ra_hir/src/mock.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 8e256b89f..e855df11d 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs | |||
@@ -6,7 +6,7 @@ use ra_db::{LocationIntener, BaseDatabase, FilePosition, mock::FileMap, FileId, | |||
6 | use relative_path::RelativePathBuf; | 6 | use relative_path::RelativePathBuf; |
7 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; | 7 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; |
8 | 8 | ||
9 | use crate::{db, DefId, DefLoc, FnId, SourceItemId}; | 9 | use crate::{db, DefId, DefLoc}; |
10 | 10 | ||
11 | #[derive(Debug)] | 11 | #[derive(Debug)] |
12 | pub(crate) struct MockDatabase { | 12 | pub(crate) struct MockDatabase { |
@@ -65,7 +65,6 @@ impl MockDatabase { | |||
65 | 65 | ||
66 | #[derive(Debug, Default)] | 66 | #[derive(Debug, Default)] |
67 | struct IdMaps { | 67 | struct IdMaps { |
68 | fns: LocationIntener<SourceItemId, FnId>, | ||
69 | defs: LocationIntener<DefLoc, DefId>, | 68 | defs: LocationIntener<DefLoc, DefId>, |
70 | } | 69 | } |
71 | 70 | ||
@@ -117,12 +116,6 @@ impl AsRef<LocationIntener<DefLoc, DefId>> for MockDatabase { | |||
117 | } | 116 | } |
118 | } | 117 | } |
119 | 118 | ||
120 | impl AsRef<LocationIntener<SourceItemId, FnId>> for MockDatabase { | ||
121 | fn as_ref(&self) -> &LocationIntener<SourceItemId, FnId> { | ||
122 | &self.id_maps.fns | ||
123 | } | ||
124 | } | ||
125 | |||
126 | impl MockDatabase { | 119 | impl MockDatabase { |
127 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> { | 120 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> { |
128 | *self.events.lock() = Some(Vec::new()); | 121 | *self.events.lock() = Some(Vec::new()); |