]> git.lizzy.rs Git - rust.git/commitdiff
libregex_macros: use unboxed closures
authorJorge Aparicio <japaricious@gmail.com>
Sun, 7 Dec 2014 17:36:42 +0000 (12:36 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sat, 13 Dec 2014 22:03:47 +0000 (17:03 -0500)
src/libregex_macros/lib.rs

index 4df8819774319e782e71a96affd38e3fb26aec4a..c1e8677fa8f3d99ccdf2baba0279bdcf6fe289b4 100644 (file)
@@ -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::Expr>) -> ast::Arm {
 
     // Converts `xs` to a `[x1, x2, .., xN]` expression by calling `to_expr`
     // on each element in `xs`.
-    fn vec_expr<T, It: Iterator<T>>(&self, xs: It,
-                                    to_expr: |&ExtCtxt, T| -> P<ast::Expr>)
-                  -> P<ast::Expr> {
+    fn vec_expr<T, It, F>(&self, xs: It, mut to_expr: F) -> P<ast::Expr> where
+        It: Iterator<T>,
+        F: FnMut(&ExtCtxt, T) -> P<ast::Expr>,
+    {
         let exprs = xs.map(|x| to_expr(self.cx, x)).collect();
         self.cx.expr_vec(self.sp, exprs)
     }