From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 9BB643AA9423; Wed, 8 Jun 2022 12:00:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BB643AA9423 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Covariant types should respect the get_name to pretty print the ir symbols X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: a6c5dbadc3c9023821244bd4af4e78ad9d8f63f2 X-Git-Newrev: 0f9257baae824948b48e8bcdbebbd7c58f296ea9 Message-Id: <20220608120012.9BB643AA9423@sourceware.org> Date: Wed, 8 Jun 2022 12:00:12 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 12:00:12 -0000 https://gcc.gnu.org/g:0f9257baae824948b48e8bcdbebbd7c58f296ea9 commit 0f9257baae824948b48e8bcdbebbd7c58f296ea9 Author: Philip Herron 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,