diff options
Diffstat (limited to 'src/libregex_macros/lib.rs')
| -rw-r--r-- | src/libregex_macros/lib.rs | 8 |
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) } |
