aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-08 10:35:30 +0000
committerGitHub <[email protected]>2019-12-08 10:35:30 +0000
commitffcdd25cc8e7f1fd7fb4e3e8478c4cd1adfbf843 (patch)
tree973ccea0049ee917a7f901a7e0238f7ef6c984bc /crates/ra_hir_expand/src/lib.rs
parent9e551d5452232d1d44e4bba754392beaa3a7628f (diff)
parent509fedd9d2f228c6dca762cbf06c31af34ac0c75 (diff)
Merge #2497
2497: Remove MacroFileKind r=matklad a=edwin0cheng This PR move `to_macro_file_kind` to `hir_expand::db` and use it to get the `FragmentKind` directly, such that we can remove `MacroFileKind`. Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r--crates/ra_hir_expand/src/lib.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 0a5da7e54..94e1e466a 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -117,14 +117,6 @@ impl HirFileId {
117#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 117#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
118pub struct MacroFile { 118pub struct MacroFile {
119 macro_call_id: MacroCallId, 119 macro_call_id: MacroCallId,
120 macro_file_kind: MacroFileKind,
121}
122
123#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
124pub enum MacroFileKind {
125 Items,
126 Expr,
127 Statements,
128} 120}
129 121
130/// `MacroCallId` identifies a particular macro invocation, like 122/// `MacroCallId` identifies a particular macro invocation, like
@@ -205,9 +197,8 @@ impl MacroCallKind {
205} 197}
206 198
207impl MacroCallId { 199impl MacroCallId {
208 pub fn as_file(self, kind: MacroFileKind) -> HirFileId { 200 pub fn as_file(self) -> HirFileId {
209 let macro_file = MacroFile { macro_call_id: self, macro_file_kind: kind }; 201 MacroFile { macro_call_id: self }.into()
210 macro_file.into()
211 } 202 }
212} 203}
213 204