From f6348f1924626ea15bc6c4e6be3f525f891767e3 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Fri, 28 May 2021 09:20:43 +0800 Subject: [PATCH] Rewrite to a `match` --- compiler/rustc_mir/src/interpret/eval_context.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_mir/src/interpret/eval_context.rs b/compiler/rustc_mir/src/interpret/eval_context.rs index 51339e5ed31..6f7519e6156 100644 --- a/compiler/rustc_mir/src/interpret/eval_context.rs +++ b/compiler/rustc_mir/src/interpret/eval_context.rs @@ -857,15 +857,14 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { panic!("Encountered StackPopCleanup::None when unwinding!") } }; - self.unwind_to_block(unwind)?; + self.unwind_to_block(unwind) } else { // Follow the normal return edge. - if let StackPopCleanup::Goto { ret, .. } = return_to_block { - self.return_to_block(ret)?; + match return_to_block { + StackPopCleanup::Goto { ret, .. } => self.return_to_block(ret), + StackPopCleanup::None { .. } => Ok(()), } } - - Ok(()) } /// Mark a storage as live, killing the previous content.