public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1040
@ 2022-06-08 12:21 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:21 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6ecd43c7797eb287f15d64f80f4654361c046f4a
commit 6ecd43c7797eb287f15d64f80f4654361c046f4a
Merge: 32894e69865 a64a5cf77c9
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Tue Mar 22 11:02:45 2022 +0000
Merge #1040
1040: Do not propagate parse errors in match repetitions r=CohenArthur a=CohenArthur
Since parsing repetitions is very eager, the parser might accumulate
bogus errors by trying to match more repetitions than there are. We can
avoid this by clearing the parsing errors if parsing repetitions
returned a valid result. This should not be an issue for previous
matchers erroring out, as they would immediately return upon failure and
not reach inside other match functions.
We need to figure out the best way to emit parser errors, as we do not always want to emit them in `match_fragment`. I think for now the easiest is to just *not* emit parse errors and simply error out with "failed to match macro rule". We will need to think about adding a bunch of hints too in order to make using macros easier.
Fixes #958
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diff:
gcc/rust/expand/rust-macro-expand.cc | 11 +++++++----
gcc/rust/parse/rust-parse.h | 3 ++-
gcc/testsuite/rust/compile/macro25.rs | 9 +++++++++
gcc/testsuite/rust/compile/macro9.rs | 1 -
4 files changed, 18 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:21 [gcc/devel/rust/master] Merge #1040 Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).