aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 6f37dd8..e53da93 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -956,6 +956,8 @@ check_match_scrutinee (HIR::MatchExpr &expr, Context *ctx)
TyTy::ADTType *adt = static_cast<TyTy::ADTType *> (scrutinee_expr_tyty);
if (adt->is_enum ())
rust_assert (adt->number_of_variants () > 0);
+ else
+ rust_assert (adt->number_of_variants () == 1);
}
else if (scrutinee_kind == TyTy::TypeKind::FLOAT)
{