public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] gccrs: Remove cmp_autoderef_mode hack from old autoderef Date: Tue, 28 Feb 2023 22:37:45 +0000 (GMT) [thread overview] Message-ID: <20230228223745.302903858C5E@sourceware.org> (raw) https://gcc.gnu.org/g:41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd commit 41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd Author: Philip Herron <herron.philip@googlemail.com> Date: Tue Feb 28 19:07:11 2023 +0000 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 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
reply other threads:[~2023-02-28 22:37 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230228223745.302903858C5E@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).