about summary refs log tree commit diff
path: root/src/compiletest
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiletest')
-rw-r--r--src/compiletest/compiletest.rs6
-rw-r--r--src/compiletest/procsrv.rs4
-rw-r--r--src/compiletest/runtest.rs18
-rw-r--r--src/compiletest/util.rs2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index b73623223fd..b16e9dea03d 100644
--- a/src/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
@@ -276,7 +276,7 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
            config.src_base.display());
     let mut tests = Vec::new();
     let dirs = fs::readdir(&config.src_base).unwrap();
-    for file in dirs.iter() {
+    for file in &dirs {
         let file = file.clone();
         debug!("inspecting file {:?}", file.display());
         if is_test(config, &file) {
@@ -304,13 +304,13 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
 
     let mut valid = false;
 
-    for ext in valid_extensions.iter() {
+    for ext in &valid_extensions {
         if name.ends_with(ext.as_slice()) {
             valid = true;
         }
     }
 
-    for pre in invalid_prefixes.iter() {
+    for pre in &invalid_prefixes {
         if name.starts_with(pre.as_slice()) {
             valid = false;
         }
diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs
index 7f3865308da..57f4171f7c2 100644
--- a/src/compiletest/procsrv.rs
+++ b/src/compiletest/procsrv.rs
@@ -46,7 +46,7 @@ pub fn run(lib_path: &str,
 
     match cmd.spawn() {
         Ok(mut process) => {
-            for input in input.iter() {
+            if let Some(input) = input {
                 process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
             }
             let ProcessOutput { status, output, error } =
@@ -78,7 +78,7 @@ pub fn run_background(lib_path: &str,
 
     match cmd.spawn() {
         Ok(mut process) => {
-            for input in input.iter() {
+            if let Some(input) = input {
                 process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
             }
 
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 18cb3d1d5b0..2143cf22e05 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -547,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
                                          exe_file.as_str().unwrap().replace("\\", "\\\\"))[]);
 
             // Add line breakpoints
-            for line in breakpoint_lines.iter() {
+            for line in &breakpoint_lines {
                 script_str.push_str(&format!("break '{}':{}\n",
                                              testfile.filename_display(),
                                              *line)[]);
@@ -683,13 +683,13 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
     script_str.push_str("type category enable Rust\n");
 
     // Set breakpoints on every line that contains the string "#break"
-    for line in breakpoint_lines.iter() {
+    for line in &breakpoint_lines {
         script_str.push_str(format!("breakpoint set --line {}\n",
                                     line).as_slice());
     }
 
     // Append the other commands
-    for line in commands.iter() {
+    for line in &commands {
         script_str.push_str(line.as_slice());
         script_str.push_str("\n");
     }
@@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
             let mut rest = line.trim();
             let mut first = true;
             let mut failed = false;
-            for frag in check_fragments[i].iter() {
+            for frag in &check_fragments[i] {
                 let found = if first {
                     if rest.starts_with(frag.as_slice()) {
                         Some(0)
@@ -915,7 +915,7 @@ fn check_error_patterns(props: &TestProps,
                               missing_patterns[0]).as_slice(),
                       proc_res);
     } else {
-        for pattern in missing_patterns.iter() {
+        for pattern in missing_patterns {
             error(format!("error pattern '{}' not found!",
                           *pattern).as_slice());
         }
@@ -935,7 +935,7 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
 fn check_forbid_output(props: &TestProps,
                        output_to_check: &str,
                        proc_res: &ProcRes) {
-    for pat in props.forbid_output.iter() {
+    for pat in &props.forbid_output {
         if output_to_check.contains(pat.as_slice()) {
             fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
         }
@@ -1173,7 +1173,7 @@ fn compose_and_run_compiler(
     // FIXME (#9639): This needs to handle non-utf8 paths
     let extra_link_args = vec!("-L".to_string(), aux_dir.as_str().unwrap().to_string());
 
-    for rel_ab in props.aux_builds.iter() {
+    for rel_ab in &props.aux_builds {
         let abs_ab = config.aux_base.join(rel_ab.as_slice());
         let aux_props = header::load_props(&abs_ab);
         let mut crate_type = if aux_props.no_prefer_dynamic {
@@ -1510,7 +1510,7 @@ fn _arm_exec_compiled_test(config: &Config,
     runargs.push(format!("{}", config.adb_test_dir));
     runargs.push(format!("{}", prog_short));
 
-    for tv in args.args.iter() {
+    for tv in &args.args {
         runargs.push(tv.to_string());
     }
     procsrv::run("",
@@ -1591,7 +1591,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
     let tdir = aux_output_dir_name(config, testfile);
 
     let dirs = fs::readdir(&tdir).unwrap();
-    for file in dirs.iter() {
+    for file in &dirs {
         if file.extension_str() == Some("so") {
             // FIXME (#9639): This needs to handle non-utf8 paths
             let copy_result = procsrv::run("",
diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs
index a116cc33690..b1e44ef34fe 100644
--- a/src/compiletest/util.rs
+++ b/src/compiletest/util.rs
@@ -26,7 +26,7 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
 ];
 
 pub fn get_os(triple: &str) -> &'static str {
-    for &(triple_os, os) in OS_TABLE.iter() {
+    for &(triple_os, os) in OS_TABLE {
         if triple.contains(triple_os) {
             return os
         }