mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
libregex_macros: use unboxed closures
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user