aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-03-17 18:09:42 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:21:13 +0100
commit6d169ce149a3af1d50ea36345a4e26805535a989 (patch)
tree98459f612ffc40e665ebe2d9a8fe2d3ffbd89d71 /gcc
parent3b8ffff2a46a7c821207f720986ccfbd6a676ac1 (diff)
downloadgcc-6d169ce149a3af1d50ea36345a4e26805535a989.zip
gcc-6d169ce149a3af1d50ea36345a4e26805535a989.tar.gz
gcc-6d169ce149a3af1d50ea36345a4e26805535a989.tar.bz2
gccrs: Fix bad method resolution
We should use the result of our attempted unify inference as this will allow the direct unification of generic pointer types to concrete ones. Fixes #1981 gcc/rust/ChangeLog: * typecheck/rust-coercion.cc (TypeCoercionRules::select): use the result Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-coercion.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/typecheck/rust-coercion.cc b/gcc/rust/typecheck/rust-coercion.cc
index b5d6cef..2cc7196 100644
--- a/gcc/rust/typecheck/rust-coercion.cc
+++ b/gcc/rust/typecheck/rust-coercion.cc
@@ -413,9 +413,9 @@ TypeCoercionRules::coerce_unsized (TyTy::BaseType *source,
bool
TypeCoercionRules::select (TyTy::BaseType &autoderefed)
{
- rust_debug (
- "autoderef type-coercion select autoderefed={%s} can_eq expected={%s}",
- autoderefed.debug_str ().c_str (), expected->debug_str ().c_str ());
+ rust_debug ("TypeCoercionRules::select autoderefed={%s} can_eq expected={%s}",
+ autoderefed.debug_str ().c_str (),
+ expected->debug_str ().c_str ());
TyTy::BaseType *result
= unify_site_and (autoderefed.get_ref (), TyTy::TyWithLocation (expected),
@@ -426,7 +426,7 @@ TypeCoercionRules::select (TyTy::BaseType &autoderefed)
if (!ok)
return false;
- try_result = CoercionResult{adjustments, autoderefed.clone ()};
+ try_result = CoercionResult{adjustments, result};
return true;
}