aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-21 21:08:32 +0000
committerGitHub <noreply@github.com>2022-01-21 21:08:32 +0000
commitc11048a764d722894ee432466282cad8ae11b312 (patch)
treef118e491df87044a5cb2862ee1067149bd8001d0
parentd956be99334b6ce2fa9f2b2942b65937ede7146d (diff)
parent0f9257baae824948b48e8bcdbebbd7c58f296ea9 (diff)
downloadgcc-c11048a764d722894ee432466282cad8ae11b312.zip
gcc-c11048a764d722894ee432466282cad8ae11b312.tar.gz
gcc-c11048a764d722894ee432466282cad8ae11b312.tar.bz2
Merge #880
880: Covariant types should respect the get_name r=philberty a=philberty This changes the Reference and Pointer types to respect the get_name convention this means the canonical name for functions with their respective substitutions string is properly formatted. Co-authored-by: Philip Herron <philip.herron@embecosm.com>
-rw-r--r--gcc/rust/typecheck/rust-tyty.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index bdf85a9..f2c250f 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,