1
Fork 0

expand: Stop un-interpolating NtIdents before passing them to built-in macros

This was a big hack, and built-in macros should be able to deal with `NtIdents` in the input by themselves like any other parser code.
This commit is contained in:
Vadim Petrochenkov 2020-09-27 19:47:52 +03:00
parent d62d3f7fa9
commit 85ef265dbe
3 changed files with 10 additions and 33 deletions

View file

@ -368,7 +368,7 @@ fn parse_reg<'a>(
explicit_reg: &mut bool,
) -> Result<ast::InlineAsmRegOrRegClass, DiagnosticBuilder<'a>> {
p.expect(&token::OpenDelim(token::DelimToken::Paren))?;
let result = match p.token.kind {
let result = match p.token.uninterpolate().kind {
token::Ident(name, false) => ast::InlineAsmRegOrRegClass::RegClass(name),
token::Literal(token::Lit { kind: token::LitKind::Str, symbol, suffix: _ }) => {
*explicit_reg = true;