diff options
| author | hyd-dev <yd-huang@outlook.com> | 2021-05-28 09:20:43 +0800 |
|---|---|---|
| committer | hyd-dev <yd-huang@outlook.com> | 2021-05-28 09:20:43 +0800 |
| commit | f6348f1924626ea15bc6c4e6be3f525f891767e3 (patch) | |
| tree | 51b6a0eca56f53d49e500368d355a9bfd59d6c9c | |
| parent | 4ad21c9a9da7ffa2a2c2c43b650f8fdec9a31a93 (diff) | |
| download | rust-f6348f1924626ea15bc6c4e6be3f525f891767e3.tar.gz rust-f6348f1924626ea15bc6c4e6be3f525f891767e3.zip | |
Rewrite to a `match`
| -rw-r--r-- | compiler/rustc_mir/src/interpret/eval_context.rs | 9 |
1 files 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. |
