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] Constify SubstitutionArg field SubstitutionParamMapping Date: Wed, 8 Jun 2022 11:40:44 +0000 (GMT) [thread overview] Message-ID: <20220608114044.4584639730E2@sourceware.org> (raw) https://gcc.gnu.org/g:3eea0076f235e854da519da50f0af4e99d31634b commit 3eea0076f235e854da519da50f0af4e99d31634b Author: Philip Herron <philip.herron@embecosm.com> Date: Wed Oct 20 16:09:31 2021 +0100 Constify SubstitutionArg field SubstitutionParamMapping Argument mappings need to reference the generic parameter they are going to substitute this should really be const since this class does not own the mapping pointer here. Diff: --- gcc/rust/typecheck/rust-tyty.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 364be5014df..03e3296c6b5 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -690,7 +690,7 @@ private: class SubstitutionArg { public: - SubstitutionArg (SubstitutionParamMapping *param, BaseType *argument) + SubstitutionArg (const SubstitutionParamMapping *param, BaseType *argument) : param (std::move (param)), argument (argument) {} @@ -707,7 +707,7 @@ public: BaseType *get_tyty () { return argument; } - SubstitutionParamMapping *get_param_mapping () { return param; } + const SubstitutionParamMapping *get_param_mapping () { return param; } static SubstitutionArg error () { return SubstitutionArg (nullptr, nullptr); } @@ -725,7 +725,7 @@ public: } private: - SubstitutionParamMapping *param; + const SubstitutionParamMapping *param; BaseType *argument; }; @@ -761,7 +761,7 @@ public: { for (auto &mapping : mappings) { - SubstitutionParamMapping *param = mapping.get_param_mapping (); + const SubstitutionParamMapping *param = mapping.get_param_mapping (); const ParamType *p = param->get_param_ty (); if (p->get_symbol ().compare (param_to_find->get_symbol ()) == 0)
reply other threads:[~2022-06-08 11:40 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=20220608114044.4584639730E2@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).