diff options
| author | bors <bors@rust-lang.org> | 2017-07-15 19:12:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-15 19:12:03 +0000 |
| commit | 086eaa78ea70075abe4e6b7fb9dc76259867b4be (patch) | |
| tree | 6116f080556e73a39ba2dfd3c9f1d2756fb24eab /src/libsyntax | |
| parent | a783fe2f77dfc69bdfbee539488403ff8883fd25 (diff) | |
| parent | b5c5a0c3fd91e2f3a61e26bf5a00297a6e2b3366 (diff) | |
| download | rust-086eaa78ea70075abe4e6b7fb9dc76259867b4be.tar.gz rust-086eaa78ea70075abe4e6b7fb9dc76259867b4be.zip | |
Auto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrc
macros: fix regression involving identifiers in `macro_rules!` patterns. Fixes #42019. r? @nrc
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/quoted.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/quoted.rs b/src/libsyntax/ext/tt/quoted.rs index 4e9e30857b1..74fa85d130b 100644 --- a/src/libsyntax/ext/tt/quoted.rs +++ b/src/libsyntax/ext/tt/quoted.rs @@ -196,7 +196,8 @@ fn parse_tree<I>(tree: tokenstream::TokenTree, num_captures: name_captures, })) } - Some(tokenstream::TokenTree::Token(ident_span, token::Ident(ident))) => { + Some(tokenstream::TokenTree::Token(ident_span, ref token)) if token.is_ident() => { + let ident = token.ident().unwrap(); let span = Span { lo: span.lo, ..ident_span }; if ident.name == keywords::Crate.name() { let ident = ast::Ident { name: keywords::DollarCrate.name(), ..ident }; |
