diff options
author | Jakub Dupak <dev@jakubdupak.com> | 2023-10-02 21:54:16 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:37 +0100 |
commit | 982f93fe139f9de6f9e0a9afd6226b4c41f4e28c (patch) | |
tree | 6eb200ec949b0a37887528b8a387b57dfaa578f4 /gcc | |
parent | 5757c304b539dc30c5cacf278bb026738288854a (diff) | |
download | gcc-982f93fe139f9de6f9e0a9afd6226b4c41f4e28c.zip gcc-982f93fe139f9de6f9e0a9afd6226b4c41f4e28c.tar.gz gcc-982f93fe139f9de6f9e0a9afd6226b4c41f4e28c.tar.bz2 |
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>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/backend/rust-compile.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 60eb81c..43c3da0 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) |