public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Covariant types should respect the get_name to pretty print the ir symbols
@ 2022-06-08 12:00 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0f9257baae824948b48e8bcdbebbd7c58f296ea9

commit 0f9257baae824948b48e8bcdbebbd7c58f296ea9
Author: Philip Herron <philip.herron@embecosm.com>
Date:   Fri Jan 21 19:28:24 2022 +0000

    Covariant types should respect the get_name to pretty print the ir symbols

Diff:
---
 gcc/rust/typecheck/rust-tyty.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index bdf85a97d39..f2c250fbe39 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -1930,7 +1930,10 @@ public:
 
   std::string as_string () const override;
 
-  std::string get_name () const override final { return as_string (); }
+  std::string get_name () const override final
+  {
+    return "&" + get_base ()->get_name ();
+  }
 
   BaseType *unify (BaseType *other) override;
   bool can_eq (const BaseType *other, bool emit_errors,
@@ -1978,7 +1981,10 @@ public:
 
   std::string as_string () const override;
 
-  std::string get_name () const override final { return as_string (); }
+  std::string get_name () const override final
+  {
+    return "*" + get_base ()->get_name ();
+  }
 
   BaseType *unify (BaseType *other) override;
   bool can_eq (const BaseType *other, bool emit_errors,


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:00 [gcc/devel/rust/master] Covariant types should respect the get_name to pretty print the ir symbols 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).