diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-10-20 16:09:31 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-10-22 10:13:06 +0100 |
commit | 3eea0076f235e854da519da50f0af4e99d31634b (patch) | |
tree | d6ebfdbb996c924b9e59801b3a69a4436a3efe00 /gcc | |
parent | ff5c2481404953dce7ef7ccfda856ba6a1ee2323 (diff) | |
download | gcc-3eea0076f235e854da519da50f0af4e99d31634b.zip gcc-3eea0076f235e854da519da50f0af4e99d31634b.tar.gz gcc-3eea0076f235e854da519da50f0af4e99d31634b.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 364be50..03e3296 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) |