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

@ -3063,7 +3063,7 @@ impl ItemId {
/// An item
///
/// The name might be a dummy name in case of anonymous items
#[derive(Debug, HashStable_Generic)]
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub struct Item<'hir> {
pub ident: Ident,
pub owner_id: OwnerId,
@ -3271,7 +3271,7 @@ impl FnHeader {
}
}
#[derive(Debug, HashStable_Generic)]
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub enum ItemKind<'hir> {
/// An `extern crate` item, with optional *original* crate name if the crate was renamed.
///
@ -3292,7 +3292,7 @@ pub enum ItemKind<'hir> {
/// A function declaration.
Fn(FnSig<'hir>, &'hir Generics<'hir>, BodyId),
/// A MBE macro definition (`macro_rules!` or `macro`).
Macro(ast::MacroDef, MacroKind),
Macro(&'hir ast::MacroDef, MacroKind),
/// A module.
Mod(&'hir Mod<'hir>),
/// An external module, e.g. `extern { .. }`.