From 0dac05dd627612232403c07ca8bd6d3376eec64a Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 8 Dec 2014 13:28:32 -0500 Subject: libsyntax: use unboxed closures --- src/libsyntax/util/parser_testing.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/util/parser_testing.rs') diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index c1ea8f60b82..83bbff8473d 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -31,7 +31,9 @@ pub fn string_to_parser<'a>(ps: &'a ParseSess, source_str: String) -> Parser<'a> source_str) } -fn with_error_checking_parse(s: String, f: |&mut Parser| -> T) -> T { +fn with_error_checking_parse(s: String, f: F) -> T where + F: FnOnce(&mut Parser) -> T, +{ let ps = new_parse_sess(); let mut p = string_to_parser(&ps, s); let x = f(&mut p); -- cgit 1.4.1-3-g733a5