From 6aeb9552148315641e49d7ab791ef6ffa638fcbe Mon Sep 17 00:00:00 2001 From: llogiq Date: Wed, 12 Aug 2015 14:02:13 +0200 Subject: [PATCH] fixed if-condition match --- src/const.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/const.rs b/src/const.rs index 924a47f2e5a7..a353de218f48 100644 --- a/src/const.rs +++ b/src/const.rs @@ -26,8 +26,8 @@ pub fn constant(cx: &Context, e: &Expr) -> Option { &ExprBlock(ref block) => constant_block(cx, inner), &ExprIf(ref cond, ref then, ref otherwise) => match constant(cx, cond) { - Some(LitBool(true)) => constant(cx, then), - Some(LitBool(false)) => constant(cx, otherwise), + Some(ConstantBool(true)) => constant(cx, then), + Some(ConstantBool(false)) => constant(cx, otherwise), _ => None, }, &ExprLit(ref lit) => Some(lit_to_constant(lit)),