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] Merge #818 Date: Wed, 8 Jun 2022 11:55:23 +0000 (GMT) [thread overview] Message-ID: <20220608115523.37C4539960EC@sourceware.org> (raw) https://gcc.gnu.org/g:0024bc2f028369b871a65ceb11b2fddfb0f9c3aa commit 0024bc2f028369b871a65ceb11b2fddfb0f9c3aa Merge: 3b8cbff816c c7af812802f Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Fri Nov 26 09:19:08 2021 +0000 Merge #818 818: Deref operator overloading r=philberty a=philberty This adds initial support for dereferencing operator overloading. We need to be able to use this as part of the autoderef cycle next. It has two default impl's one for '&T' and '&mut T' to apply genericly. The reason it is interesting is from the prototype the deref lang item always returns &Self::Target in all cases regardless of mutability, the lang item here is designed to wrap up any dereference such that when applied it guarentees the type system you will get back an immutable reference to something. The reason for doing this is more clear when thinking about autoderef and method-resolution and how you apply dereference operations to custom types and a test case is included for that. Fixes #809 Co-authored-by: Philip Herron <philip.herron@embecosm.com> Diff: gcc/rust/backend/rust-compile-expr.cc | 37 ++++++++++ gcc/rust/backend/rust-compile-expr.h | 21 +----- gcc/rust/typecheck/rust-hir-type-check-expr.h | 33 ++++++++- gcc/rust/util/rust-hir-map.h | 8 +++ .../rust/execute/torture/operator_overload_10.rs | 79 ++++++++++++++++++++++ .../rust/execute/torture/operator_overload_7.rs | 44 ++++++++++++ .../rust/execute/torture/operator_overload_8.rs | 61 +++++++++++++++++ .../rust/execute/torture/operator_overload_9.rs | 61 +++++++++++++++++ 8 files changed, 321 insertions(+), 23 deletions(-)
reply other threads:[~2022-06-08 11:55 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=20220608115523.37C4539960EC@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).