]> git.lizzy.rs Git - rust.git/commitdiff
compiletest: remove boxed closures
authorJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 03:05:29 +0000 (22:05 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Mon, 5 Jan 2015 22:22:14 +0000 (17:22 -0500)
src/compiletest/compiletest.rs
src/compiletest/header.rs
src/compiletest/runtest.rs

index 350a10ce4832a9debfe68b687f3e2dc578cba0ab..48610b6b526d22899df5a4061453f673fd761cd5 100644 (file)
@@ -339,8 +339,9 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
     return valid;
 }
 
-pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
-                 -> test::TestDescAndFn {
+pub fn make_test<F>(config: &Config, testfile: &Path, f: F) -> test::TestDescAndFn where
+    F: FnOnce() -> test::TestFn,
+{
     test::TestDescAndFn {
         desc: test::TestDesc {
             name: make_test_name(config, testfile),
index 27be6c6d8356889e700203280c56e285e476364f..2413a001ee8053b5bdbf9d90c8c0836f332c8bb7 100644 (file)
@@ -220,7 +220,9 @@ fn ignore_lldb(config: &Config, line: &str) -> bool {
     !val
 }
 
-fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
+fn iter_header<F>(testfile: &Path, mut it: F) -> bool where
+    F: FnMut(&str) -> bool,
+{
     use std::io::{BufferedReader, File};
 
     let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
index c513aec0b843a9ac793fc7276b46718ceb4b0dab..875061e69b7a28ce49bfc6c8070dbd5bb6f4c619 100644 (file)
@@ -1233,12 +1233,14 @@ enum TargetLocation {
     ThisDirectory(Path),
 }
 
-fn make_compile_args(config: &Config,
-                     props: &TestProps,
-                     extras: Vec<String> ,
-                     xform: |&Config, &Path| -> TargetLocation,
-                     testfile: &Path)
-                     -> ProcArgs {
+fn make_compile_args<F>(config: &Config,
+                        props: &TestProps,
+                        extras: Vec<String> ,
+                        xform: F,
+                        testfile: &Path)
+                        -> ProcArgs where
+    F: FnOnce(&Config, &Path) -> TargetLocation,
+{
     let xform_file = xform(config, testfile);
     let target = if props.force_host {
         config.host.as_slice()