Skip to content

Commit e28c009

Browse files
committed
gccrs: Fix bad method resolution
TODO Fixes #1981 gcc/rust/ChangeLog: * typecheck/rust-coercion.cc (TypeCoercionRules::select): Signed-off-by: Philip Herron <[email protected]>
1 parent 4fb08f9 commit e28c009

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gcc/rust/typecheck/rust-coercion.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ TypeCoercionRules::coerce_unsized (TyTy::BaseType *source,
413413
bool
414414
TypeCoercionRules::select (TyTy::BaseType &autoderefed)
415415
{
416-
rust_debug (
417-
"autoderef type-coercion select autoderefed={%s} can_eq expected={%s}",
418-
autoderefed.debug_str ().c_str (), expected->debug_str ().c_str ());
416+
rust_debug ("TypeCoercionRules::select autoderefed={%s} can_eq expected={%s}",
417+
autoderefed.debug_str ().c_str (),
418+
expected->debug_str ().c_str ());
419419

420420
TyTy::BaseType *result
421421
= unify_site_and (autoderefed.get_ref (), TyTy::TyWithLocation (expected),
@@ -426,7 +426,7 @@ TypeCoercionRules::select (TyTy::BaseType &autoderefed)
426426
if (!ok)
427427
return false;
428428

429-
try_result = CoercionResult{adjustments, autoderefed.clone ()};
429+
try_result = CoercionResult{adjustments, result};
430430
return true;
431431
}
432432

0 commit comments

Comments
 (0)