aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-expand.cc
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-06-26 13:06:10 -0400
committerCohenArthur <arthur.cohen@embecosm.com>2023-06-27 07:50:44 +0000
commit96ba341e0fd4799bcd22535fc2166a9ac96628ca (patch)
tree499e9808e9954aa1f00603443f6a24c822d4e12b /gcc/rust/expand/rust-macro-expand.cc
parent4c07c94212e2cc43bf4c01eb195347821791659b (diff)
downloadgcc-96ba341e0fd4799bcd22535fc2166a9ac96628ca.zip
gcc-96ba341e0fd4799bcd22535fc2166a9ac96628ca.tar.gz
gcc-96ba341e0fd4799bcd22535fc2166a9ac96628ca.tar.bz2
Match tokens in macros more closely
gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::match_token): Match token instead of token id. * parse/rust-parse-impl.h (Parser::skip_token): Add token-skipping variant. (Parser::expect_token): Likewise. * parse/rust-parse.h (Parser::skip_token): Likewise. (Parser::expect_token): Likewise. gcc/testsuite/ChangeLog: * rust/compile/macro-issue2264.rs: New test. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.cc')
-rw-r--r--gcc/rust/expand/rust-macro-expand.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc
index 358d8fb..a45c13f 100644
--- a/gcc/rust/expand/rust-macro-expand.cc
+++ b/gcc/rust/expand/rust-macro-expand.cc
@@ -569,8 +569,7 @@ MacroExpander::match_matcher (Parser<MacroInvocLexer> &parser,
bool
MacroExpander::match_token (Parser<MacroInvocLexer> &parser, AST::Token &token)
{
- // FIXME this needs to actually match the content and the type
- return parser.skip_token (token.get_id ());
+ return parser.skip_token (token.get_tok_ptr ());
}
bool