From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 302903858C5E; Tue, 28 Feb 2023 22:37:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 302903858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677623865; bh=FUPXvNijij+XpzmXnCtjbsnALryjsfgG28JmWB+gdOg=; h=From:To:Subject:Date:From; b=qyJC1q0xlwi2puGunw0sXn9t6AFz2M0mLUnM5GHrWB4/WcTgStXJ7ZePUw7YVb9Cn +JYeuqZF0RZIx8vq4gY2kxybQuYp3xoZaL5WaVVptBbb+B9h2TByIdcDNmd1C45gj6 wPysPmFJaU2sa4+V2dJxXWm28EwPUVm9s4H2gtIs= 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] gccrs: Remove cmp_autoderef_mode hack from old autoderef X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 43a92787e3ff964ade498be3a6a1b6adc1f41087 X-Git-Newrev: 41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd Message-Id: <20230228223745.302903858C5E@sourceware.org> Date: Tue, 28 Feb 2023 22:37:45 +0000 (GMT) List-Id: https://gcc.gnu.org/g:41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd commit 41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd Author: Philip Herron Date: Tue Feb 28 19:07:11 2023 +0000 gccrs: Remove cmp_autoderef_mode hack from old autoderef Signed-off-by: Philip Herron 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 Diff: --- gcc/rust/typecheck/rust-tyty-cmp.h | 12 +----------- gcc/rust/typecheck/rust-tyty.cc | 13 ------------- gcc/rust/typecheck/rust-tyty.h | 5 ----- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/gcc/rust/typecheck/rust-tyty-cmp.h b/gcc/rust/typecheck/rust-tyty-cmp.h index 293c8bfa641..9006eb1b954 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 28d03ce52c5..110f59266f3 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 05cd3a78dd8..b729437f73d 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