1
Fork 0

Also arena-allocate ast::MacroDef to make Item: Copy

This commit is contained in:
Nilstrieb 2023-03-25 21:09:11 +01:00
parent ed8d67d8ba
commit 74e31ec64c
3 changed files with 6 additions and 5 deletions

View file

@ -443,7 +443,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
ItemKind::MacroDef(MacroDef { body, macro_rules }) => {
let body = P(self.lower_delim_args(body));
let macro_kind = self.resolver.decl_macro_kind(self.local_def_id(id));
hir::ItemKind::Macro(ast::MacroDef { body, macro_rules: *macro_rules }, macro_kind)
let macro_def = self.arena.alloc(ast::MacroDef { body, macro_rules: *macro_rules });
hir::ItemKind::Macro(macro_def, macro_kind)
}
ItemKind::MacCall(..) => {
panic!("`TyMac` should have been expanded by now")