From b44b5da8c2ad8befb7deb88dc8df61508e1df22f Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 7 Dec 2014 12:36:42 -0500 Subject: [PATCH] libregex_macros: use unboxed closures --- src/libregex_macros/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs index 4df881977431..c1e8677fa8f3 100644 --- a/src/libregex_macros/lib.rs +++ b/src/libregex_macros/lib.rs @@ -19,6 +19,7 @@ html_root_url = "http://doc.rust-lang.org/nightly/")] #![feature(plugin_registrar, quote)] +#![feature(unboxed_closures)] extern crate regex; extern crate syntax; @@ -601,9 +602,10 @@ fn wild_arm_expr(&self, body: P) -> ast::Arm { // Converts `xs` to a `[x1, x2, .., xN]` expression by calling `to_expr` // on each element in `xs`. - fn vec_expr>(&self, xs: It, - to_expr: |&ExtCtxt, T| -> P) - -> P { + fn vec_expr(&self, xs: It, mut to_expr: F) -> P where + It: Iterator, + F: FnMut(&ExtCtxt, T) -> P, + { let exprs = xs.map(|x| to_expr(self.cx, x)).collect(); self.cx.expr_vec(self.sp, exprs) }