From fb6638c1630b87f8b06d27ffb6acf8a6f337d7e1 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Thu, 18 Apr 2019 17:29:42 +0200 Subject: [PATCH] Add better proof --- src/prepare/compile.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/prepare/compile.rs b/src/prepare/compile.rs index 98dbb8d..76fdef2 100644 --- a/src/prepare/compile.rs +++ b/src/prepare/compile.rs @@ -148,10 +148,14 @@ impl Compiler { "label_stack should reflect the frame stack; frame stack is never empty while being processed; qed", ); - let (if_not, end_label) = match top_label { BlockFrameType::IfTrue { if_not, end_label } => (if_not, end_label), - _ => panic!("validation ensures that the top frame is actually if_true"), + _ => unreachable!( + "validation ensures that the top frame was opened by If block; + `top_label` should be `IfTrue` at this point; + this statement is unreachable; + qed" + ), }; // First, we need to finish if-true block: add a jump from the end of the if-true block