aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-29 19:33:49 +0100
committerGitHub <[email protected]>2021-05-29 19:33:49 +0100
commit505329b9bb66484276f2b04ee2aa2c59ccce72d6 (patch)
tree127d90ba4f4eac66081f9b78a2d53d2d713a0593 /crates/hir_expand
parentf6da603c7fe56c19a275dc7bab1f30fe1ad39707 (diff)
parent8c639a87bdbd08b10d4eb84d00f25ba7bcd56be0 (diff)
Merge #9057
9057: internal: Thread proc-macro types through the HIR r=jonas-schievink a=jonas-schievink Should help with completion of derives. cc @Veykril bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/lib.rs5
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;
15pub mod eager; 15pub mod eager;
16mod input; 16mod input;
17 17
18use base_db::ProcMacroKind;
18use either::Either; 19use either::Either;
19 20
20pub use mbe::{ExpandError, ExpandResult}; 21pub 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)]