diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 1 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/macro51.rs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 67c4f6a..c48c71f 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -2081,6 +2081,7 @@ Parser<ManagedTokenSource>::parse_macro_match () case WHILE: case YIELD: case IDENTIFIER: + case UNDERSCORE: // macro fragment return parse_macro_match_fragment (); case LEFT_PAREN: diff --git a/gcc/testsuite/rust/compile/macro51.rs b/gcc/testsuite/rust/compile/macro51.rs new file mode 100644 index 0000000..6659486 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro51.rs @@ -0,0 +1,3 @@ +macro_rules! test { + ($_:ident) => {""} +} |