diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-03-08 15:06:17 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-09 18:18:35 +0000 |
commit | 99980cbb5efdaa935d841b4e523ea758568b1827 (patch) | |
tree | e72269c83bb18e1b22046c008cb680f02ab95884 /gcc | |
parent | 537f59bdef827b8f265f7d155567ca2dc835301b (diff) | |
download | gcc-99980cbb5efdaa935d841b4e523ea758568b1827.zip gcc-99980cbb5efdaa935d841b4e523ea758568b1827.tar.gz gcc-99980cbb5efdaa935d841b4e523ea758568b1827.tar.bz2 |
Missing const on method
Getting mappings can be const in order to get mappings info on Types.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-full-test.cc | 2 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-full-test.cc b/gcc/rust/hir/tree/rust-hir-full-test.cc index fb5f665..9d26a0bd 100644 --- a/gcc/rust/hir/tree/rust-hir-full-test.cc +++ b/gcc/rust/hir/tree/rust-hir-full-test.cc @@ -3242,7 +3242,7 @@ TypePath::to_trait_bound (bool in_parens) const std::string InferredType::as_string () const { - return "_ (inferred)"; + return "_ (inferred) " + get_mappings ().as_string (); } std::string diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h index 97f303c..5198635 100644 --- a/gcc/rust/hir/tree/rust-hir.h +++ b/gcc/rust/hir/tree/rust-hir.h @@ -981,7 +981,7 @@ public: virtual void accept_vis (HIRVisitor &vis) = 0; - virtual Analysis::NodeMapping get_mappings () { return mappings; } + virtual Analysis::NodeMapping get_mappings () const { return mappings; } protected: Type (Analysis::NodeMapping mappings) : mappings (mappings) {} |