@@ -242,7 +242,7 @@ struct DebuggerCommands {
242
242
243
243
enum ReadFrom {
244
244
Path ,
245
- Stdin ,
245
+ Stdin ( String ) ,
246
246
}
247
247
248
248
impl < ' test > TestCx < ' test > {
@@ -426,11 +426,14 @@ impl<'test> TestCx<'test> {
426
426
round, self . revision
427
427
) ,
428
428
) ;
429
- let read_from = if round == 0 { ReadFrom :: Path } else { ReadFrom :: Stdin } ;
430
- let proc_res = self . print_source ( srcs[ round] . to_owned ( ) ,
431
- & self . props . pretty_mode ,
432
- read_from) ;
429
+ let read_from = if round == 0 {
430
+ ReadFrom :: Path
431
+ } else {
432
+ ReadFrom :: Stdin ( srcs[ round] . to_owned ( ) )
433
+ } ;
433
434
435
+ let proc_res = self . print_source ( read_from,
436
+ & self . props . pretty_mode ) ;
434
437
if !proc_res. status . success ( ) {
435
438
self . fatal_proc_rec (
436
439
& format ! (
@@ -485,7 +488,7 @@ impl<'test> TestCx<'test> {
485
488
}
486
489
487
490
// additionally, run `--pretty expanded` and try to build it.
488
- let proc_res = self . print_source ( srcs [ round ] . clone ( ) , "expanded" , ReadFrom :: Path ) ;
491
+ let proc_res = self . print_source ( ReadFrom :: Path , "expanded" ) ;
489
492
if !proc_res. status . success ( ) {
490
493
self . fatal_proc_rec ( "pretty-printing (expanded) failed" , & proc_res) ;
491
494
}
@@ -503,10 +506,10 @@ impl<'test> TestCx<'test> {
503
506
}
504
507
}
505
508
506
- fn print_source ( & self , src : String , pretty_type : & str , read_from : ReadFrom ) -> ProcRes {
509
+ fn print_source ( & self , read_from : ReadFrom , pretty_type : & str ) -> ProcRes {
507
510
let aux_dir = self . aux_output_dir_name ( ) ;
508
511
let input: & str = match read_from {
509
- ReadFrom :: Stdin => "-" ,
512
+ ReadFrom :: Stdin ( _ ) => "-" ,
510
513
ReadFrom :: Path => self . testpaths . file . to_str ( ) . unwrap ( ) ,
511
514
} ;
512
515
@@ -521,16 +524,16 @@ impl<'test> TestCx<'test> {
521
524
. args ( & self . props . compile_flags )
522
525
. envs ( self . props . exec_env . clone ( ) ) ;
523
526
524
- let src_to_read = match read_from {
525
- ReadFrom :: Stdin => Some ( src) ,
527
+ let src = match read_from {
528
+ ReadFrom :: Stdin ( src ) => Some ( src) ,
526
529
ReadFrom :: Path => None
527
530
} ;
528
531
529
532
self . compose_and_run (
530
533
rustc,
531
534
self . config . compile_lib_path . to_str ( ) . unwrap ( ) ,
532
535
Some ( aux_dir. to_str ( ) . unwrap ( ) ) ,
533
- src_to_read ,
536
+ src ,
534
537
)
535
538
}
536
539
0 commit comments