html_root_url = "http://doc.rust-lang.org/nightly/")]
#![feature(plugin_registrar, quote)]
+#![feature(unboxed_closures)]
extern crate regex;
extern crate syntax;
// 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)
}