diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-02-28 19:07:11 +0000 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:19:00 +0100 |
commit | 4c77c7ac0f2ad11e48a32d7a98b3ca1005df8678 (patch) | |
tree | 3e55eead495ff1031fbdccb2f8e8c61534446a8e /gcc | |
parent | 7017e9de8209c18bbbb8664dca14e3ea04e4156f (diff) | |
download | gcc-4c77c7ac0f2ad11e48a32d7a98b3ca1005df8678.zip gcc-4c77c7ac0f2ad11e48a32d7a98b3ca1005df8678.tar.gz gcc-4c77c7ac0f2ad11e48a32d7a98b3ca1005df8678.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')
-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 df0e4b1..49a2bde 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 dc7a08f..219068e 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 5516cd7..c7d5db3 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 |