From bc1eb8481029856d41df3ae2a404cbfe51b80016 Mon Sep 17 00:00:00 2001 From: llogiq Date: Wed, 2 Sep 2015 07:56:13 +0200 Subject: [PATCH] match region patterns --- src/shadow.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shadow.rs b/src/shadow.rs index 2276fb1da5d..d64f6840db8 100644 --- a/src/shadow.rs +++ b/src/shadow.rs @@ -130,17 +130,17 @@ fn check_pat(cx: &Context, pat: &Pat, init: &Option<&Expr>, span: Span, }, PatBox(ref inner) => { if let Some(ref initp) = *init { - match initp.node { - ExprBox(_, ref inner_init) => - check_pat(cx, inner, &Some(&**inner_init), span, bindings), - //TODO: ExprCall on Box::new - _ => check_pat(cx, inner, init, span, bindings), + if let ExprBox(_, ref inner_init) = initp.node { + check_pat(cx, inner, &Some(&**inner_init), span, bindings), + } else { + check_pat(cx, inner, init, span, bindings), } } else { check_pat(cx, inner, init, span, bindings); } }, - //PatRegion(P, Mutability), + PatRegion(ref inner, _) => + check_pat(cx, inner, init, span, bindings), //PatRange(P, P), //PatVec(Vec>, Option>, Vec>), _ => (),