diff options
author | Jonas Schievink <[email protected]> | 2021-05-29 19:32:57 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-29 19:32:57 +0100 |
commit | 8c639a87bdbd08b10d4eb84d00f25ba7bcd56be0 (patch) | |
tree | 127d90ba4f4eac66081f9b78a2d53d2d713a0593 /crates/hir_expand | |
parent | f6da603c7fe56c19a275dc7bab1f30fe1ad39707 (diff) |
Thread proc-macro types through the HIR
Diffstat (limited to 'crates/hir_expand')
-rw-r--r-- | crates/hir_expand/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 10d37234e..90d8ae240 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs | |||
@@ -15,6 +15,7 @@ pub mod quote; | |||
15 | pub mod eager; | 15 | pub mod eager; |
16 | mod input; | 16 | mod input; |
17 | 17 | ||
18 | use base_db::ProcMacroKind; | ||
18 | use either::Either; | 19 | use either::Either; |
19 | 20 | ||
20 | pub use mbe::{ExpandError, ExpandResult}; | 21 | pub use mbe::{ExpandError, ExpandResult}; |
@@ -207,7 +208,7 @@ impl MacroDefId { | |||
207 | MacroDefKind::BuiltIn(_, id) => id, | 208 | MacroDefKind::BuiltIn(_, id) => id, |
208 | MacroDefKind::BuiltInDerive(_, id) => id, | 209 | MacroDefKind::BuiltInDerive(_, id) => id, |
209 | MacroDefKind::BuiltInEager(_, id) => id, | 210 | MacroDefKind::BuiltInEager(_, id) => id, |
210 | MacroDefKind::ProcMacro(_, id) => return Either::Right(*id), | 211 | MacroDefKind::ProcMacro(.., id) => return Either::Right(*id), |
211 | }; | 212 | }; |
212 | Either::Left(*id) | 213 | Either::Left(*id) |
213 | } | 214 | } |
@@ -224,7 +225,7 @@ pub enum MacroDefKind { | |||
224 | // FIXME: maybe just Builtin and rename BuiltinFnLikeExpander to BuiltinExpander | 225 | // FIXME: maybe just Builtin and rename BuiltinFnLikeExpander to BuiltinExpander |
225 | BuiltInDerive(BuiltinDeriveExpander, AstId<ast::Macro>), | 226 | BuiltInDerive(BuiltinDeriveExpander, AstId<ast::Macro>), |
226 | BuiltInEager(EagerExpander, AstId<ast::Macro>), | 227 | BuiltInEager(EagerExpander, AstId<ast::Macro>), |
227 | ProcMacro(ProcMacroExpander, AstId<ast::Fn>), | 228 | ProcMacro(ProcMacroExpander, ProcMacroKind, AstId<ast::Fn>), |
228 | } | 229 | } |
229 | 230 | ||
230 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 231 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |