@@ -31,7 +31,7 @@ use std::old_io::process::ProcessExit;
31
31
use std:: old_io:: process;
32
32
use std:: old_io:: timer;
33
33
use std:: old_io;
34
- use std:: os ;
34
+ use std:: env ;
35
35
use std:: iter:: repeat;
36
36
use std:: str;
37
37
use std:: string:: String ;
@@ -547,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
547
547
exe_file. as_str( ) . unwrap( ) . replace( "\\ " , "\\ \\ " ) ) [ ] ) ;
548
548
549
549
// Add line breakpoints
550
- for line in breakpoint_lines. iter ( ) {
550
+ for line in & breakpoint_lines {
551
551
script_str. push_str ( & format ! ( "break '{}':{}\n " ,
552
552
testfile. filename_display( ) ,
553
553
* line) [ ] ) ;
@@ -683,13 +683,13 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
683
683
script_str. push_str ( "type category enable Rust\n " ) ;
684
684
685
685
// Set breakpoints on every line that contains the string "#break"
686
- for line in breakpoint_lines. iter ( ) {
686
+ for line in & breakpoint_lines {
687
687
script_str. push_str ( format ! ( "breakpoint set --line {}\n " ,
688
688
line) . as_slice ( ) ) ;
689
689
}
690
690
691
691
// Append the other commands
692
- for line in commands. iter ( ) {
692
+ for line in & commands {
693
693
script_str. push_str ( line. as_slice ( ) ) ;
694
694
script_str. push_str ( "\n " ) ;
695
695
}
@@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
847
847
let mut rest = line. trim ( ) ;
848
848
let mut first = true ;
849
849
let mut failed = false ;
850
- for frag in check_fragments[ i] . iter ( ) {
850
+ for frag in & check_fragments[ i] {
851
851
let found = if first {
852
852
if rest. starts_with ( frag. as_slice ( ) ) {
853
853
Some ( 0 )
@@ -915,7 +915,7 @@ fn check_error_patterns(props: &TestProps,
915
915
missing_patterns[ 0 ] ) . as_slice ( ) ,
916
916
proc_res) ;
917
917
} else {
918
- for pattern in missing_patterns. iter ( ) {
918
+ for pattern in missing_patterns {
919
919
error ( format ! ( "error pattern '{}' not found!" ,
920
920
* pattern) . as_slice ( ) ) ;
921
921
}
@@ -935,7 +935,7 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
935
935
fn check_forbid_output ( props : & TestProps ,
936
936
output_to_check : & str ,
937
937
proc_res : & ProcRes ) {
938
- for pat in props. forbid_output . iter ( ) {
938
+ for pat in & props. forbid_output {
939
939
if output_to_check. contains ( pat. as_slice ( ) ) {
940
940
fatal_proc_rec ( "forbidden pattern found in compiler output" , proc_res) ;
941
941
}
@@ -1173,7 +1173,7 @@ fn compose_and_run_compiler(
1173
1173
// FIXME (#9639): This needs to handle non-utf8 paths
1174
1174
let extra_link_args = vec ! ( "-L" . to_string( ) , aux_dir. as_str( ) . unwrap( ) . to_string( ) ) ;
1175
1175
1176
- for rel_ab in props. aux_builds . iter ( ) {
1176
+ for rel_ab in & props. aux_builds {
1177
1177
let abs_ab = config. aux_base . join ( rel_ab. as_slice ( ) ) ;
1178
1178
let aux_props = header:: load_props ( & abs_ab) ;
1179
1179
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 {
1298
1298
1299
1299
fn make_exe_name ( config : & Config , testfile : & Path ) -> Path {
1300
1300
let mut f = output_base_name ( config, testfile) ;
1301
- if !os :: consts:: EXE_SUFFIX . is_empty ( ) {
1301
+ if !env :: consts:: EXE_SUFFIX . is_empty ( ) {
1302
1302
let mut fname = f. filename ( ) . unwrap ( ) . to_vec ( ) ;
1303
- fname. extend ( os :: consts:: EXE_SUFFIX . bytes ( ) ) ;
1303
+ fname. extend ( env :: consts:: EXE_SUFFIX . bytes ( ) ) ;
1304
1304
f. set_filename ( fname) ;
1305
1305
}
1306
1306
f
@@ -1503,14 +1503,14 @@ fn _arm_exec_compiled_test(config: &Config,
1503
1503
1504
1504
// run test via adb_run_wrapper
1505
1505
runargs. push ( "shell" . to_string ( ) ) ;
1506
- for ( key, val) in env. into_iter ( ) {
1506
+ for ( key, val) in env {
1507
1507
runargs. push ( format ! ( "{}={}" , key, val) ) ;
1508
1508
}
1509
1509
runargs. push ( format ! ( "{}/adb_run_wrapper.sh" , config. adb_test_dir) ) ;
1510
1510
runargs. push ( format ! ( "{}" , config. adb_test_dir) ) ;
1511
1511
runargs. push ( format ! ( "{}" , prog_short) ) ;
1512
1512
1513
- for tv in args. args . iter ( ) {
1513
+ for tv in & args. args {
1514
1514
runargs. push ( tv. to_string ( ) ) ;
1515
1515
}
1516
1516
procsrv:: run ( "" ,
@@ -1591,7 +1591,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
1591
1591
let tdir = aux_output_dir_name ( config, testfile) ;
1592
1592
1593
1593
let dirs = fs:: readdir ( & tdir) . unwrap ( ) ;
1594
- for file in dirs. iter ( ) {
1594
+ for file in & dirs {
1595
1595
if file. extension_str ( ) == Some ( "so" ) {
1596
1596
// FIXME (#9639): This needs to handle non-utf8 paths
1597
1597
let copy_result = procsrv:: run ( "" ,
0 commit comments