1
Fork 0

Shrink ast::Attribute.

This commit is contained in:
Nicholas Nethercote 2022-08-11 21:06:11 +10:00
parent 40336865fe
commit 85a6cd6a47
15 changed files with 167 additions and 149 deletions

View file

@ -39,6 +39,7 @@
#[macro_use]
extern crate tracing;
use rustc_ast::ptr::P;
use rustc_ast::visit;
use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust;
@ -873,14 +874,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// the `HirId`s. We don't actually need HIR version of attributes anyway.
// Tokens are also not needed after macro expansion and parsing.
let kind = match attr.kind {
AttrKind::Normal(ref item, _) => AttrKind::Normal(
AttrItem {
path: item.path.clone(),
args: self.lower_mac_args(&item.args),
AttrKind::Normal(ref normal) => AttrKind::Normal(P(NormalAttr {
item: AttrItem {
path: normal.item.path.clone(),
args: self.lower_mac_args(&normal.item.args),
tokens: None,
},
None,
),
tokens: None,
})),
AttrKind::DocComment(comment_kind, data) => AttrKind::DocComment(comment_kind, data),
};