From f0511851bc4555346641efd2249328433b781355 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 9 Jan 2024 16:37:23 +0100 Subject: [PATCH] Don't mix combinators and `let else` Co-authored-by: Michael Goulet --- compiler/rustc_mir_build/src/thir/pattern/check_match.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index 74d1afcea4d..47941525cc2 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -430,9 +430,12 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> { } let scrut_ty = scrut.ty; - let Ok(report) = analyze_match(&cx, &tarms, scrut_ty).map_err(|err| self.error = Err(err)) - else { - return; + let report = match analyze_match(&cx, &tarms, scrut_ty) { + Ok(report) => report, + Err(err) => { + self.error = Err(err); + return; + } }; match source {