File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -356,11 +356,17 @@ impl Command {
356
356
. unwrap_or_else ( |_| "0" . into ( ) )
357
357
. parse ( )
358
358
. context ( "failed to parse MIRI_SEED_START" ) ?;
359
- let seed_count: u64 = env:: var ( "MIRI_SEEDS" )
360
- . unwrap_or_else ( |_| "256" . into ( ) )
361
- . parse ( )
362
- . context ( "failed to parse MIRI_SEEDS" ) ?;
363
- let seed_end = seed_start + seed_count;
359
+ let seed_end: u64 = match ( env:: var ( "MIRI_SEEDS" ) , env:: var ( "MIRI_SEED_END" ) ) {
360
+ ( Ok ( _) , Ok ( _) ) => bail ! ( "Only one of MIRI_SEEDS and MIRI_SEED_END may be set" ) ,
361
+ ( Ok ( seeds) , Err ( _) ) =>
362
+ seed_start + seeds. parse :: < u64 > ( ) . context ( "failed to parse MIRI_SEEDS" ) ?,
363
+ ( Err ( _) , Ok ( seed_end) ) => seed_end. parse ( ) . context ( "failed to parse MIRI_SEED_END" ) ?,
364
+ ( Err ( _) , Err ( _) ) => seed_start + 256 ,
365
+ } ;
366
+ if seed_end <= seed_start {
367
+ bail ! ( "the end of the seed range must be larger than the start." ) ;
368
+ }
369
+
364
370
let Some ( ( command_name, trailing_args) ) = command. split_first ( ) else {
365
371
bail ! ( "expected many-seeds command to be non-empty" ) ;
366
372
} ;
Original file line number Diff line number Diff line change @@ -113,8 +113,9 @@ sysroot, to prevent conflicts with other toolchains.
113
113
./miri many-seeds <command>:
114
114
Runs <command> over and over again with different seeds for Miri. The MIRIFLAGS
115
115
variable is set to its original value appended with ` -Zmiri-seed=$SEED` for
116
- many different seeds. The MIRI_SEEDS variable controls how many seeds are being
117
- tried; MIRI_SEED_START controls the first seed to try.
116
+ many different seeds. MIRI_SEED_START controls the first seed to try (default: 0).
117
+ MIRI_SEEDS controls how many seeds are being tried (default: 256);
118
+ alternatively, MIRI_SEED_END controls the end of the (exclusive) seed range to try.
118
119
119
120
./miri bench <benches>:
120
121
Runs the benchmarks from bench-cargo-miri in hyperfine. hyperfine needs to be installed.
You can’t perform that action at this time.
0 commit comments