@@ -2,7 +2,7 @@ use std::collections::HashMap;
22use std:: ffi:: { OsStr , OsString } ;
33use std:: fs:: File ;
44use std:: io:: { BufReader , BufWriter , Write } ;
5- use std:: ops:: { Not , Range } ;
5+ use std:: ops:: Not ;
66use std:: path:: PathBuf ;
77use std:: time:: Duration ;
88use std:: { env, net, process} ;
@@ -178,8 +178,8 @@ impl Command {
178178 Command :: Check { flags } => Self :: check ( flags) ,
179179 Command :: Test { bless, flags, target, coverage } =>
180180 Self :: test ( bless, flags, target, coverage) ,
181- Command :: Run { dep, verbose, many_seeds , target, edition, flags } =>
182- Self :: run ( dep, verbose, many_seeds , target, edition, flags) ,
181+ Command :: Run { dep, verbose, target, edition, flags } =>
182+ Self :: run ( dep, verbose, target, edition, flags) ,
183183 Command :: Doc { flags } => Self :: doc ( flags) ,
184184 Command :: Fmt { flags } => Self :: fmt ( flags) ,
185185 Command :: Clippy { flags } => Self :: clippy ( flags) ,
@@ -586,7 +586,6 @@ impl Command {
586586 fn run (
587587 dep : bool ,
588588 verbose : bool ,
589- many_seeds : Option < Range < u32 > > ,
590589 target : Option < String > ,
591590 edition : Option < String > ,
592591 flags : Vec < String > ,
@@ -614,48 +613,34 @@ impl Command {
614613 early_flags. push ( "--sysroot" . into ( ) ) ;
615614 early_flags. push ( miri_sysroot. into ( ) ) ;
616615
617- // Compute everything needed to run the actual command. Also add MIRIFLAGS .
616+ // Compute flags .
618617 let miri_flags = e. sh . var ( "MIRIFLAGS" ) . unwrap_or_default ( ) ;
619618 let miri_flags = flagsplit ( & miri_flags) ;
620619 let quiet_flag = if verbose { None } else { Some ( "--quiet" ) } ;
621- // This closure runs the command with the given `seed_flag` added between the MIRIFLAGS and
622- // the `flags` given on the command-line.
623- let run_miri = |e : & MiriEnv , seed_flag : Option < String > | -> Result < ( ) > {
624- // The basic command that executes the Miri driver.
625- let mut cmd = if dep {
626- // We invoke the test suite as that has all the logic for running with dependencies.
627- e. cargo_cmd ( "." , "test" )
628- . args ( & [ "--test" , "ui" ] )
629- . args ( quiet_flag)
630- . arg ( "--" )
631- . args ( & [ "--miri-run-dep-mode" ] )
632- } else {
633- cmd ! ( e. sh, "{miri_bin}" )
634- } ;
635- cmd. set_quiet ( !verbose) ;
636- // Add Miri flags
637- let mut cmd = cmd. args ( & miri_flags) . args ( & seed_flag) . args ( & early_flags) . args ( & flags) ;
638- // For `--dep` we also need to set the target in the env var.
639- if dep {
640- if let Some ( target) = & target {
641- cmd = cmd. env ( "MIRI_TEST_TARGET" , target) ;
642- }
643- }
644- // And run the thing.
645- Ok ( cmd. run ( ) ?)
646- } ;
647- // Run the closure once or many times.
648- if let Some ( seed_range) = many_seeds {
649- e. run_many_times ( seed_range, |e, seed| {
650- eprintln ! ( "Trying seed: {seed}" ) ;
651- run_miri ( e, Some ( format ! ( "-Zmiri-seed={seed}" ) ) ) . inspect_err ( |_| {
652- eprintln ! ( "FAILING SEED: {seed}" ) ;
653- } )
654- } ) ?;
620+
621+ // Run Miri.
622+ // The basic command that executes the Miri driver.
623+ let mut cmd = if dep {
624+ // We invoke the test suite as that has all the logic for running with dependencies.
625+ e. cargo_cmd ( "." , "test" )
626+ . args ( & [ "--test" , "ui" ] )
627+ . args ( quiet_flag)
628+ . arg ( "--" )
629+ . args ( & [ "--miri-run-dep-mode" ] )
655630 } else {
656- run_miri ( & e, None ) ?;
631+ cmd ! ( e. sh, "{miri_bin}" )
632+ } ;
633+ cmd. set_quiet ( !verbose) ;
634+ // Add Miri flags
635+ let mut cmd = cmd. args ( & miri_flags) . args ( & early_flags) . args ( & flags) ;
636+ // For `--dep` we also need to set the target in the env var.
637+ if dep {
638+ if let Some ( target) = & target {
639+ cmd = cmd. env ( "MIRI_TEST_TARGET" , target) ;
640+ }
657641 }
658- Ok ( ( ) )
642+ // Finally, run the thing.
643+ Ok ( cmd. run ( ) ?)
659644 }
660645
661646 fn fmt ( flags : Vec < String > ) -> Result < ( ) > {
0 commit comments