Store an AstId for procedural macros

This commit is contained in:
Jonas Schievink 2021-03-18 16:11:18 +01:00
parent 3ab9b39dd4
commit c05a1a6e37
11 changed files with 47 additions and 26 deletions

View file

@ -245,7 +245,7 @@ impl MacroDefId {
MacroDefKind::BuiltIn(_, id) => id,
MacroDefKind::BuiltInDerive(_, id) => id,
MacroDefKind::BuiltInEager(_, id) => id,
MacroDefKind::ProcMacro(_) => return None,
MacroDefKind::ProcMacro(..) => return None,
};
Some(*id)
}
@ -258,7 +258,7 @@ pub enum MacroDefKind {
// FIXME: maybe just Builtin and rename BuiltinFnLikeExpander to BuiltinExpander
BuiltInDerive(BuiltinDeriveExpander, AstId<ast::Macro>),
BuiltInEager(EagerExpander, AstId<ast::Macro>),
ProcMacro(ProcMacroExpander),
ProcMacro(ProcMacroExpander, AstId<ast::Fn>),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]