diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-12-24 11:45:09 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-01-23 13:19:27 +0000 |
commit | 3638b0551e48f7a9b292409f750174727ea7a5e2 (patch) | |
tree | b5a9d9c13331935cfb2d7f7c3a76e159b389656c /gcc/rust/backend/rust-compile-expr.cc | |
parent | b87fd67fa807665d741968b7aca4b9399f2071db (diff) | |
download | gcc-3638b0551e48f7a9b292409f750174727ea7a5e2.zip gcc-3638b0551e48f7a9b292409f750174727ea7a5e2.tar.gz gcc-3638b0551e48f7a9b292409f750174727ea7a5e2.tar.bz2 |
backend: Allow anything as a match scrutinee
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (check_match_scrutinee): Allow anything to be used as a
match scrutinee, not just ADTs.
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index c24a22a..1d68e85 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -31,6 +31,7 @@ #include "convert.h" #include "print-tree.h" #include "rust-system.h" +#include "rust-tyty.h" namespace Rust { namespace Compile { @@ -1035,11 +1036,6 @@ check_match_scrutinee (HIR::MatchExpr &expr, Context *ctx) } TyTy::TypeKind scrutinee_kind = scrutinee_expr_tyty->get_kind (); - rust_assert ((TyTy::is_primitive_type_kind (scrutinee_kind) - && scrutinee_kind != TyTy::TypeKind::NEVER) - || scrutinee_kind == TyTy::TypeKind::ADT - || scrutinee_kind == TyTy::TypeKind::TUPLE - || scrutinee_kind == TyTy::TypeKind::REF); if (scrutinee_kind == TyTy::TypeKind::FLOAT) { |