public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1587
@ 2022-10-14 12:46 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-14 12:46 UTC (permalink / raw)
To: gcc-cvs
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(-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-14 12:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 12:46 [gcc/devel/rust/master] Merge #1587 Thomas Schwinge
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).