Auto merge of #80441 - petrochenkov:kwtok, r=Aaron1011

ast: Remove some indirection layers from values in key-value attributes

Trying to address some perf regressions from https://github.com/rust-lang/rust/pull/78837#issuecomment-745380762.
This commit is contained in:
bors 2021-01-09 22:19:46 +00:00
commit f30733adb9
12 changed files with 72 additions and 50 deletions

View file

@ -983,8 +983,8 @@ impl<'a> Parser<'a> {
_ => self.sess.gated_spans.gate(sym::extended_key_value_attributes, span),
}
let token = token::Interpolated(Lrc::new(token::NtExpr(expr)));
MacArgs::Eq(eq_span, TokenTree::token(token, span).into())
let token_kind = token::Interpolated(Lrc::new(token::NtExpr(expr)));
MacArgs::Eq(eq_span, Token::new(token_kind, span))
} else {
MacArgs::Empty
}