about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-07 12:36:42 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-13 17:03:47 -0500
commitb44b5da8c2ad8befb7deb88dc8df61508e1df22f (patch)
treefa3ee9786a2efc04d7cf71855201da96e9c4f878
parent879ebce6a4023632cfd448749997ce3e4e24b05d (diff)
downloadrust-b44b5da8c2ad8befb7deb88dc8df61508e1df22f.tar.gz
rust-b44b5da8c2ad8befb7deb88dc8df61508e1df22f.zip
libregex_macros: use unboxed closures
-rw-r--r--src/libregex_macros/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs
index 4df88197743..c1e8677fa8f 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 exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
 
     // 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)
     }