From 1a4ceeeb65735c56f72423bc34de9a3c20af5614 Mon Sep 17 00:00:00 2001 From: Folkert Date: Mon, 12 Jul 2021 17:58:02 +0200 Subject: [PATCH] be more precise --- compiler/mono/src/exhaustive.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/mono/src/exhaustive.rs b/compiler/mono/src/exhaustive.rs index e9804e2c27..14d70270bf 100644 --- a/compiler/mono/src/exhaustive.rs +++ b/compiler/mono/src/exhaustive.rs @@ -353,7 +353,7 @@ fn to_nonredundant_rows( vec![simplify(&loc_pat.value)] }; - if any_has_guard || is_useful(checked_rows.clone(), next_row.clone()) { + if matches!(guard, Guard::HasGuard) || is_useful(checked_rows.clone(), next_row.clone()) { checked_rows.push(next_row); } else { return Err(Error::Redundant {