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 #1587 Date: Fri, 14 Oct 2022 12:46:08 +0000 (GMT) [thread overview] Message-ID: <20221014124608.98E923858024@sourceware.org> (raw) https://gcc.gnu.org/g:c85492954ded963d937de1fa8731be0718d117eb commit c85492954ded963d937de1fa8731be0718d117eb Merge: 84ca2f9123a 9bac2dbfe99 Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Fri Oct 14 09:31:25 2022 +0000 Merge #1587 1587: Method resolution must support multiple candidates r=philberty a=philberty This patch fixes bad method resolution in our operator_overload_9 case. When we have a &mut reference to something and we deref we must resolve to the mutable reference impl block. The interface we are using to resolve methods is the can_eq interface which allows for permissive mutability which means allowing for mutable reference being unified with an immutable one. This meant we actual match against both the immutable and mutable version leading to multiple candidate error. Fixes #1588 Co-authored-by: Philip Herron <philip.herron@embecosm.com> Diff: gcc/rust/typecheck/rust-autoderef.cc | 12 +++- gcc/rust/typecheck/rust-hir-dot-operator.cc | 80 ++++++++++++++++++---- gcc/rust/typecheck/rust-hir-dot-operator.h | 16 +++-- .../typecheck/rust-hir-inherent-impl-overlap.h | 5 +- gcc/rust/typecheck/rust-hir-type-check-expr.cc | 35 ++++++++-- gcc/rust/typecheck/rust-tyty-cmp.h | 14 +++- gcc/rust/typecheck/rust-tyty.cc | 13 ++++ gcc/rust/typecheck/rust-tyty.h | 5 ++ gcc/testsuite/rust/compile/generics7.rs | 6 +- .../rust/execute/torture/operator_overload_9.rs | 2 +- 10 files changed, 157 insertions(+), 31 deletions(-)
reply other threads:[~2022-10-14 12:46 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=20221014124608.98E923858024@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).