aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2023-10-02 21:54:16 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-10-03 07:02:40 +0000
commit1908504f62d75e1084923c4e1ace6c3784299344 (patch)
treeac6f005786f3cf47e03bd83e579093bbad5efcb7
parent289722166ed9dabc35cf4130bdd34f803babea57 (diff)
downloadgcc-1908504f62d75e1084923c4e1ace6c3784299344.zip
gcc-1908504f62d75e1084923c4e1ace6c3784299344.tar.gz
gcc-1908504f62d75e1084923c4e1ace6c3784299344.tar.bz2
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>
-rw-r--r--gcc/rust/backend/rust-compile.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 2799199..404b90a 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -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)