@@ -31,7 +31,7 @@ use std::old_io::process::ProcessExit;
3131use std:: old_io:: process;
3232use std:: old_io:: timer;
3333use std:: old_io;
34- use std:: os ;
34+ use std:: env ;
3535use std:: iter:: repeat;
3636use std:: str;
3737use std:: string:: String ;
@@ -547,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
547547 exe_file. as_str( ) . unwrap( ) . replace( "\\ " , "\\ \\ " ) ) [ ] ) ;
548548
549549 // Add line breakpoints
550- for line in breakpoint_lines. iter ( ) {
550+ for line in & breakpoint_lines {
551551 script_str. push_str ( & format ! ( "break '{}':{}\n " ,
552552 testfile. filename_display( ) ,
553553 * line) [ ] ) ;
@@ -683,13 +683,13 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
683683 script_str. push_str ( "type category enable Rust\n " ) ;
684684
685685 // Set breakpoints on every line that contains the string "#break"
686- for line in breakpoint_lines. iter ( ) {
686+ for line in & breakpoint_lines {
687687 script_str. push_str ( format ! ( "breakpoint set --line {}\n " ,
688688 line) . as_slice ( ) ) ;
689689 }
690690
691691 // Append the other commands
692- for line in commands. iter ( ) {
692+ for line in & commands {
693693 script_str. push_str ( line. as_slice ( ) ) ;
694694 script_str. push_str ( "\n " ) ;
695695 }
@@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
847847 let mut rest = line. trim ( ) ;
848848 let mut first = true ;
849849 let mut failed = false ;
850- for frag in check_fragments[ i] . iter ( ) {
850+ for frag in & check_fragments[ i] {
851851 let found = if first {
852852 if rest. starts_with ( frag. as_slice ( ) ) {
853853 Some ( 0 )
@@ -915,7 +915,7 @@ fn check_error_patterns(props: &TestProps,
915915 missing_patterns[ 0 ] ) . as_slice ( ) ,
916916 proc_res) ;
917917 } else {
918- for pattern in missing_patterns. iter ( ) {
918+ for pattern in missing_patterns {
919919 error ( format ! ( "error pattern '{}' not found!" ,
920920 * pattern) . as_slice ( ) ) ;
921921 }
@@ -935,7 +935,7 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
935935fn check_forbid_output ( props : & TestProps ,
936936 output_to_check : & str ,
937937 proc_res : & ProcRes ) {
938- for pat in props. forbid_output . iter ( ) {
938+ for pat in & props. forbid_output {
939939 if output_to_check. contains ( pat. as_slice ( ) ) {
940940 fatal_proc_rec ( "forbidden pattern found in compiler output" , proc_res) ;
941941 }
@@ -1173,7 +1173,7 @@ fn compose_and_run_compiler(
11731173 // FIXME (#9639): This needs to handle non-utf8 paths
11741174 let extra_link_args = vec ! ( "-L" . to_string( ) , aux_dir. as_str( ) . unwrap( ) . to_string( ) ) ;
11751175
1176- for rel_ab in props. aux_builds . iter ( ) {
1176+ for rel_ab in & props. aux_builds {
11771177 let abs_ab = config. aux_base . join ( rel_ab. as_slice ( ) ) ;
11781178 let aux_props = header:: load_props ( & abs_ab) ;
11791179 let mut crate_type = if aux_props. no_prefer_dynamic {
@@ -1298,9 +1298,9 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12981298
12991299fn make_exe_name ( config : & Config , testfile : & Path ) -> Path {
13001300 let mut f = output_base_name ( config, testfile) ;
1301- if !os :: consts:: EXE_SUFFIX . is_empty ( ) {
1301+ if !env :: consts:: EXE_SUFFIX . is_empty ( ) {
13021302 let mut fname = f. filename ( ) . unwrap ( ) . to_vec ( ) ;
1303- fname. extend ( os :: consts:: EXE_SUFFIX . bytes ( ) ) ;
1303+ fname. extend ( env :: consts:: EXE_SUFFIX . bytes ( ) ) ;
13041304 f. set_filename ( fname) ;
13051305 }
13061306 f
@@ -1503,14 +1503,14 @@ fn _arm_exec_compiled_test(config: &Config,
15031503
15041504 // run test via adb_run_wrapper
15051505 runargs. push ( "shell" . to_string ( ) ) ;
1506- for ( key, val) in env. into_iter ( ) {
1506+ for ( key, val) in env {
15071507 runargs. push ( format ! ( "{}={}" , key, val) ) ;
15081508 }
15091509 runargs. push ( format ! ( "{}/adb_run_wrapper.sh" , config. adb_test_dir) ) ;
15101510 runargs. push ( format ! ( "{}" , config. adb_test_dir) ) ;
15111511 runargs. push ( format ! ( "{}" , prog_short) ) ;
15121512
1513- for tv in args. args . iter ( ) {
1513+ for tv in & args. args {
15141514 runargs. push ( tv. to_string ( ) ) ;
15151515 }
15161516 procsrv:: run ( "" ,
@@ -1591,7 +1591,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
15911591 let tdir = aux_output_dir_name ( config, testfile) ;
15921592
15931593 let dirs = fs:: readdir ( & tdir) . unwrap ( ) ;
1594- for file in dirs. iter ( ) {
1594+ for file in & dirs {
15951595 if file. extension_str ( ) == Some ( "so" ) {
15961596 // FIXME (#9639): This needs to handle non-utf8 paths
15971597 let copy_result = procsrv:: run ( "" ,
0 commit comments