Skip to content

Commit a8cf025

Browse files
committed
gccrs: Make the coerce borrowed pointer consistent with try flag
This interface is not respecting the coercion api commit is always false, we need to ensure this is respected via the try flag like the rest of the coercion logic. gcc/rust/ChangeLog: * typecheck/rust-coercion.cc (TypeCoercionRules::select): respect try flag Signed-off-by: Philip Herron <[email protected]>
1 parent 456dbb4 commit a8cf025

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/rust/typecheck/rust-coercion.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ TypeCoercionRules::select (TyTy::BaseType &autoderefed)
439439
= unify_site_and (autoderefed.get_ref (), TyTy::TyWithLocation (expected),
440440
TyTy::TyWithLocation (&autoderefed),
441441
UNDEF_LOCATION /* locus */, false /*emit_errors*/,
442-
false /*commit_if_ok*/, true /*infer*/, true /*cleanup*/);
442+
!try_flag /*commit_if_ok*/, try_flag /*infer*/,
443+
try_flag /*cleanup*/);
443444
bool ok = result->get_kind () != TyTy::TypeKind::ERROR;
444445
if (!ok)
445446
return false;

0 commit comments

Comments
 (0)