public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Merge #1040 Date: Wed, 8 Jun 2022 12:21:53 +0000 (GMT) [thread overview] Message-ID: <20220608122153.06F493AAA070@sourceware.org> (raw) 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(-)
reply other threads:[~2022-06-08 12:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220608122153.06F493AAA070@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).