aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-tyty-cmp.h12
-rw-r--r--gcc/rust/typecheck/rust-tyty.cc13
-rw-r--r--gcc/rust/typecheck/rust-tyty.h5
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