diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-02-28 19:07:11 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-02-28 20:38:35 +0000 |
commit | 41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd (patch) | |
tree | 1a642d83c5fd5d9f33467b414bc29539309bc29c /gcc/rust | |
parent | 43a92787e3ff964ade498be3a6a1b6adc1f41087 (diff) | |
download | gcc-41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd.zip gcc-41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd.tar.gz gcc-41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd.tar.bz2 |
gccrs: Remove cmp_autoderef_mode hack from old autoderef
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:
* typecheck/rust-tyty-cmp.h: remove
* typecheck/rust-tyty.cc (set_cmp_autoderef_mode): likewise
(reset_cmp_autoderef_mode): likewise
* typecheck/rust-tyty.h (set_cmp_autoderef_mode): likewise
(reset_cmp_autoderef_mode): likewise
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-cmp.h | 12 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.cc | 13 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 5 |
3 files changed, 1 insertions, 29 deletions
diff --git a/gcc/rust/typecheck/rust-tyty-cmp.h b/gcc/rust/typecheck/rust-tyty-cmp.h index 293c8bf..9006eb1 100644 --- a/gcc/rust/typecheck/rust-tyty-cmp.h +++ b/gcc/rust/typecheck/rust-tyty-cmp.h @@ -28,10 +28,6 @@ namespace Rust { namespace TyTy { -// we need to fix this properly by implementing the match for assembling -// candidates -extern bool autoderef_cmp_flag; - class BaseCmp : public TyConstVisitor { public: @@ -1271,9 +1267,6 @@ public: auto other_base_type = type.get_base (); bool mutability_ok = base->is_mutable () ? type.is_mutable () : true; - if (autoderef_cmp_flag) - mutability_ok = base->mutability () == type.mutability (); - if (!mutability_ok) { BaseCmp::visit (type); @@ -1320,9 +1313,6 @@ public: auto other_base_type = type.get_base (); bool mutability_ok = base->is_mutable () ? type.is_mutable () : true; - if (autoderef_cmp_flag) - mutability_ok = base->mutability () == type.mutability (); - if (!mutability_ok) { BaseCmp::visit (type); @@ -1401,7 +1391,7 @@ public: void visit (const ArrayType &) override { ok = true; } - void visit (const SliceType &) override { ok = !autoderef_cmp_flag; } + void visit (const SliceType &) override { ok = true; } void visit (const BoolType &) override { ok = true; } diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index 28d03ce..110f592 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -38,19 +38,6 @@ namespace Rust { namespace TyTy { -bool autoderef_cmp_flag = false; - -void -set_cmp_autoderef_mode () -{ - autoderef_cmp_flag = true; -} -void -reset_cmp_autoderef_mode () -{ - autoderef_cmp_flag = false; -} - std::string TypeKindFormat::to_string (TypeKind kind) { diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 05cd3a7..b729437 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -77,11 +77,6 @@ public: static std::string to_string (TypeKind kind); }; -extern void -set_cmp_autoderef_mode (); -extern void -reset_cmp_autoderef_mode (); - class TyVisitor; class TyConstVisitor; class BaseType : public TypeBoundsMappings |