@@ -61,7 +61,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
61
61
print ! ( "\n \n " ) ;
62
62
}
63
63
let testfile = Path :: new ( testfile) ;
64
- debug ! ( "running {}" , testfile. display( ) ) ;
64
+ debug ! ( "running {:? }" , testfile. display( ) ) ;
65
65
let props = header:: load_props ( & testfile) ;
66
66
debug ! ( "loaded props" ) ;
67
67
match config. mode {
@@ -141,7 +141,7 @@ fn check_correct_failure_status(proc_res: &ProcRes) {
141
141
static RUST_ERR : int = 101 ;
142
142
if !proc_res. status . matches_exit_status ( RUST_ERR ) {
143
143
fatal_proc_rec (
144
- format ! ( "failure produced the wrong error: {}" ,
144
+ format ! ( "failure produced the wrong error: {:? }" ,
145
145
proc_res. status) . as_slice ( ) ,
146
146
proc_res) ;
147
147
}
@@ -410,7 +410,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
410
410
] ,
411
411
vec ! ( ( "" . to_string( ) , "" . to_string( ) ) ) ,
412
412
Some ( "" . to_string ( ) ) )
413
- . expect ( format ! ( "failed to exec `{}`" , config. adb_path) . as_slice ( ) ) ;
413
+ . expect ( format ! ( "failed to exec `{:? }`" , config. adb_path) . as_slice ( ) ) ;
414
414
415
415
procsrv:: run ( "" ,
416
416
config. adb_path . as_slice ( ) ,
@@ -422,7 +422,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
422
422
] ,
423
423
vec ! ( ( "" . to_string( ) , "" . to_string( ) ) ) ,
424
424
Some ( "" . to_string ( ) ) )
425
- . expect ( format ! ( "failed to exec `{}`" , config. adb_path) . as_slice ( ) ) ;
425
+ . expect ( format ! ( "failed to exec `{:? }`" , config. adb_path) . as_slice ( ) ) ;
426
426
427
427
let adb_arg = format ! ( "export LD_LIBRARY_PATH={}; \
428
428
gdbserver :5039 {}/{}",
@@ -443,11 +443,11 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
443
443
vec ! ( ( "" . to_string( ) ,
444
444
"" . to_string( ) ) ) ,
445
445
Some ( "" . to_string ( ) ) )
446
- . expect ( format ! ( "failed to exec `{}`" , config. adb_path) . as_slice ( ) ) ;
446
+ . expect ( format ! ( "failed to exec `{:? }`" , config. adb_path) . as_slice ( ) ) ;
447
447
loop {
448
448
//waiting 1 second for gdbserver start
449
449
timer:: sleep ( Duration :: milliseconds ( 1000 ) ) ;
450
- let result = Thread :: spawn ( move || {
450
+ let result = Thread :: scoped ( move || {
451
451
tcp:: TcpStream :: connect ( "127.0.0.1:5039" ) . unwrap ( ) ;
452
452
} ) . join ( ) ;
453
453
if result. is_err ( ) {
@@ -481,7 +481,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
481
481
debugger_opts. as_slice ( ) ,
482
482
vec ! ( ( "" . to_string( ) , "" . to_string( ) ) ) ,
483
483
None )
484
- . expect ( format ! ( "failed to exec `{}`" , gdb_path) . as_slice ( ) ) ;
484
+ . expect ( format ! ( "failed to exec `{:? }`" , gdb_path) . as_slice ( ) ) ;
485
485
let cmdline = {
486
486
let cmdline = make_cmdline ( "" ,
487
487
"arm-linux-androideabi-gdb" ,
@@ -539,18 +539,17 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
539
539
script_str. push_str ( "set print pretty off\n " ) ;
540
540
541
541
// Add the pretty printer directory to GDB's source-file search path
542
- script_str. push_str ( format ! ( "directory {}\n " , rust_pp_module_abs_path) [ ] ) ;
542
+ script_str. push_str ( & format ! ( "directory {}\n " , rust_pp_module_abs_path) [ ] ) ;
543
543
544
544
// Load the target executable
545
- script_str. push_str ( format ! ( "file {}\n " ,
546
- exe_file. as_str( ) . unwrap( ) . replace( "\\ " , "\\ \\ " ) )
547
- . as_slice ( ) ) ;
545
+ script_str. push_str ( & format ! ( "file {}\n " ,
546
+ exe_file. as_str( ) . unwrap( ) . replace( "\\ " , "\\ \\ " ) ) [ ] ) ;
548
547
549
548
// Add line breakpoints
550
549
for line in breakpoint_lines. iter ( ) {
551
- script_str. push_str ( format ! ( "break '{}':{}\n " ,
552
- testfile. filename_display( ) ,
553
- * line) [ ] ) ;
550
+ script_str. push_str ( & format ! ( "break '{:? }':{}\n " ,
551
+ testfile. filename_display( ) ,
552
+ * line) [ ] ) ;
554
553
}
555
554
556
555
script_str. push_str ( cmds. as_slice ( ) ) ;
@@ -676,7 +675,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
676
675
. unwrap ( )
677
676
. to_string ( ) ;
678
677
679
- script_str. push_str ( format ! ( "command script import {}\n " , rust_pp_module_abs_path[ ] ) [ ] ) ;
678
+ script_str. push_str ( & format ! ( "command script import {}\n " , & rust_pp_module_abs_path[ ] ) [ ] ) ;
680
679
script_str. push_str ( "type summary add --no-value " ) ;
681
680
script_str. push_str ( "--python-function lldb_rust_formatters.print_val " ) ;
682
681
script_str. push_str ( "-x \" .*\" --category Rust\n " ) ;
@@ -889,7 +888,7 @@ fn check_error_patterns(props: &TestProps,
889
888
output_to_check : & str ,
890
889
proc_res : & ProcRes ) {
891
890
if props. error_patterns . is_empty ( ) {
892
- fatal ( format ! ( "no error pattern specified in {}" ,
891
+ fatal ( format ! ( "no error pattern specified in {:? }" ,
893
892
testfile. display( ) ) . as_slice ( ) ) ;
894
893
}
895
894
let mut next_err_idx = 0 u;
@@ -910,7 +909,7 @@ fn check_error_patterns(props: &TestProps,
910
909
if done { return ; }
911
910
912
911
let missing_patterns =
913
- props. error_patterns [ next_err_idx..] ;
912
+ props. error_patterns . index ( & ( next_err_idx..) ) ;
914
913
if missing_patterns. len ( ) == 1 u {
915
914
fatal_proc_rec ( format ! ( "error pattern '{}' not found!" ,
916
915
missing_patterns[ 0 ] ) . as_slice ( ) ,
@@ -955,7 +954,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
955
954
}
956
955
957
956
let prefixes = expected_errors. iter ( ) . map ( |ee| {
958
- format ! ( "{}:{}:" , testfile. display( ) , ee. line)
957
+ format ! ( "{:? }:{}:" , testfile. display( ) , ee. line)
959
958
} ) . collect :: < Vec < String > > ( ) ;
960
959
961
960
#[ cfg( windows) ]
@@ -1191,7 +1190,7 @@ fn compose_and_run_compiler(
1191
1190
None ) ;
1192
1191
if !auxres. status . success ( ) {
1193
1192
fatal_proc_rec (
1194
- format ! ( "auxiliary build of {} failed to compile: " ,
1193
+ format ! ( "auxiliary build of {:? } failed to compile: " ,
1195
1194
abs_ab. display( ) ) . as_slice ( ) ,
1196
1195
& auxres) ;
1197
1196
}
@@ -1601,7 +1600,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
1601
1600
. expect ( format ! ( "failed to exec `{}`" , config. adb_path) . as_slice ( ) ) ;
1602
1601
1603
1602
if config. verbose {
1604
- println ! ( "push ({}) {} {} {}" ,
1603
+ println ! ( "push ({}) {:? } {} {}" ,
1605
1604
config. target, file. display( ) ,
1606
1605
copy_result. out, copy_result. err) ;
1607
1606
}
0 commit comments