diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-31 09:56:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 09:56:35 +0000 |
commit | 9011184f38a04f81ba3194b826bec3f30a11c07b (patch) | |
tree | d85ff3be8c56dfb9d27c64a856b3523e197b41f6 /gcc/rust/ast/rust-macro.h | |
parent | f9c1a14dab4c47c774f9c7661afc4bb2176eb9bb (diff) | |
parent | 73532817fd6f5aa4f59953f4111217a75135a78b (diff) | |
download | gcc-9011184f38a04f81ba3194b826bec3f30a11c07b.zip gcc-9011184f38a04f81ba3194b826bec3f30a11c07b.tar.gz gcc-9011184f38a04f81ba3194b826bec3f30a11c07b.tar.bz2 |
Merge #1071
1071: Allow transcribing of zero nodes in certain cases r=CohenArthur a=CohenArthur
When expanding AST fragments containing multiple nodes, we must be aware
that some cases allow expanding zero or more nodes. Any macro
transcription that gets parsed as many nodes (ie any transcriber function that calls `parse_many`) needs to be able to parse zero of those nodes and still get expanded properly (basically, removed).
Previously, this would cause a failure to lower the macro invocation which would remain as a child instead of getting stripped/erased.
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r-- | gcc/rust/ast/rust-macro.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h index 1d92283..5ab82c4 100644 --- a/gcc/rust/ast/rust-macro.h +++ b/gcc/rust/ast/rust-macro.h @@ -469,7 +469,7 @@ class MacroRulesDefinition : public MacroItem static ASTFragment dummy_builtin (Location, MacroInvocData &) { gcc_unreachable (); - return ASTFragment::create_empty (); + return ASTFragment::create_error (); } /* NOTE: in rustc, macro definitions are considered (and parsed as) a type |