public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Arthur Cohen <arthur.cohen@embecosm.com>, gcc-patches@gcc.gnu.org
Cc: gcc-rust@gcc.gnu.org
Subject: Re: [PATCH 2/2] Experiment with adding an error code to an error
Date: Wed, 06 Sep 2023 10:19:26 -0400	[thread overview]
Message-ID: <8ec322161f314e3cbf3fa50a1ed3accc0c1dccc3.camel@redhat.com> (raw)
In-Reply-To: <20230906135303.3643659-3-arthur.cohen@embecosm.com>

On Wed, 2023-09-06 at 15:53 +0200, Arthur Cohen wrote:
> From: David Malcolm <dmalcolm@redhat.com>

This is probably something for the gcc-rust maintainers to review
(rather than me self-reviewing with my "diagnostics maintainer" hat
on).

Doesn't have a ChangeLog entry, FWIW.
Doesn't have a signed-off-by, so here's one:

Signed-off-by: David Malcolm <dmalcolm@redhat.com>

[...snip...]

> diff --git a/gcc/rust/rust-gcc-diagnostics.cc b/gcc/rust/rust-gcc-
> diagnostics.cc
> index 72d2c068541..58c0a5654ea 100644
> --- a/gcc/rust/rust-gcc-diagnostics.cc
> +++ b/gcc/rust/rust-gcc-diagnostics.cc

[...snip...]

> +void
> +rust_be_error_at (const RichLocation &location, const ErrorCode
> code,
> +                 const std::string &errmsg)
> +{
> +  /* TODO: 'error_at' would like a non-'const' 'rich_location *'. 

The above comment should refer to "error_meta", rather than
"error_at"...

> */
> +  rich_location &gcc_loc = const_cast<rich_location &> (location.get
> ());
> +  diagnostic_metadata m;
> +  rust_error_code_rule rule (code);
> +  m.add_rule (rule);
> +  error_meta (&gcc_loc, m, "%s", errmsg.c_str ());

... to match this call.

[...snip...]

Otherwise, LGTM, but as I said, this is more in the gcc-rust
maintainers' area.

Dave


  reply	other threads:[~2023-09-06 14:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 13:53 [PATCHSET] Add error metadata to diagnostics Arthur Cohen
2023-09-06 13:53 ` [PATCH 1/2] diagnostics: add error_meta Arthur Cohen
2023-09-06 14:12   ` David Malcolm
2023-09-06 14:24     ` Arthur Cohen
2023-09-06 13:53 ` [PATCH 2/2] Experiment with adding an error code to an error Arthur Cohen
2023-09-06 14:19   ` David Malcolm [this message]
2023-09-07  9:39 ` [PATCHSET] Add error metadata to diagnostics Arthur Cohen

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=8ec322161f314e3cbf3fa50a1ed3accc0c1dccc3.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=arthur.cohen@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc-rust@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: link
Be 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).