public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Constify SubstitutionArg field SubstitutionParamMapping
@ 2022-06-08 11:40 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 11:40 UTC (permalink / raw)
  To: gcc-cvs

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:40 [gcc/devel/rust/master] Constify SubstitutionArg field SubstitutionParamMapping 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).