gccrs: Fix type confusion in coercion

There was a mismatch between a manual discriminant test and the static cast.

gcc/rust/ChangeLog:

	* backend/rust-compile.cc (HIRCompileBase::coercion_site1): Fix wrong cast

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
This commit is contained in:
Jakub Dupak 2023-10-02 21:54:16 +02:00 committed by Arthur Cohen
parent 5757c304b5
commit 982f93fe13

View file

@ -115,8 +115,8 @@ HIRCompileBase::coercion_site1 (tree rvalue, TyTy::BaseType *rval,
if (!valid_coercion)
return error_mark_node;
const TyTy::ReferenceType *exp
= static_cast<const TyTy::ReferenceType *> (expected);
const TyTy::PointerType *exp
= static_cast<const TyTy::PointerType *> (expected);
TyTy::BaseType *actual_base = nullptr;
if (actual->get_kind () == TyTy::TypeKind::REF)