expand: Stop un-interpolating NtIdent
s 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:
parent
d62d3f7fa9
commit
85ef265dbe
3 changed files with 10 additions and 33 deletions
|
@ -27,15 +27,15 @@ pub fn expand_concat_idents<'cx>(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
match e {
|
||||
TokenTree::Token(Token { kind: token::Ident(name, _), .. }) => {
|
||||
res_str.push_str(&name.as_str())
|
||||
}
|
||||
_ => {
|
||||
cx.span_err(sp, "concat_idents! requires ident args.");
|
||||
return DummyResult::any(sp);
|
||||
if let TokenTree::Token(token) = e {
|
||||
if let Some((ident, _)) = token.ident() {
|
||||
res_str.push_str(&ident.name.as_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
cx.span_err(sp, "concat_idents! requires ident args.");
|
||||
return DummyResult::any(sp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue