@@ -496,16 +496,6 @@ struct LocalOptions {
496
496
#[ clap( long) ]
497
497
id : Option < String > ,
498
498
499
- /// Measure the build profiles in this comma-separated list
500
- #[ clap(
501
- long = "profiles" ,
502
- alias = "builds" , // the old name, for backward compatibility
503
- value_parser = ProfileArgParser ,
504
- // Don't run rustdoc by default
505
- default_value = "Check,Debug,Opt" ,
506
- ) ]
507
- profiles : ProfileArg ,
508
-
509
499
/// The path to the local Cargo to use
510
500
#[ clap( long, parse( from_os_str) ) ]
511
501
cargo : Option < PathBuf > ,
@@ -517,10 +507,19 @@ struct LocalOptions {
517
507
/// Include only benchmarks matching a prefix in this comma-separated list
518
508
#[ clap( long) ]
519
509
include : Option < String > ,
510
+ }
520
511
521
- /// The path to the local rustdoc to measure
522
- #[ clap( long, parse( from_os_str) ) ]
523
- rustdoc : Option < PathBuf > ,
512
+ #[ derive( Debug , clap:: Args ) ]
513
+ struct CompileTimeOptions {
514
+ /// Measure the build profiles in this comma-separated list
515
+ #[ clap(
516
+ long = "profiles" ,
517
+ alias = "builds" , // the old name, for backward compatibility
518
+ value_parser = ProfileArgParser ,
519
+ // Don't run rustdoc by default
520
+ default_value = "Check,Debug,Opt" ,
521
+ ) ]
522
+ profiles : ProfileArg ,
524
523
525
524
/// Measure the scenarios in this comma-separated list
526
525
#[ clap(
@@ -530,6 +529,10 @@ struct LocalOptions {
530
529
default_value = "All"
531
530
) ]
532
531
scenarios : ScenarioArg ,
532
+
533
+ /// The path to the local rustdoc to measure
534
+ #[ clap( long, parse( from_os_str) ) ]
535
+ rustdoc : Option < PathBuf > ,
533
536
}
534
537
535
538
#[ derive( Debug , clap:: Args ) ]
@@ -585,6 +588,9 @@ enum Commands {
585
588
#[ clap( flatten) ]
586
589
local : LocalOptions ,
587
590
591
+ #[ clap( flatten) ]
592
+ opts : CompileTimeOptions ,
593
+
588
594
#[ clap( flatten) ]
589
595
db : DbOption ,
590
596
@@ -632,6 +638,9 @@ enum Commands {
632
638
#[ clap( flatten) ]
633
639
local : LocalOptions ,
634
640
641
+ #[ clap( flatten) ]
642
+ opts : CompileTimeOptions ,
643
+
635
644
/// Output directory
636
645
#[ clap( long = "out-dir" , default_value = "results/" ) ]
637
646
out_dir : PathBuf ,
@@ -723,20 +732,21 @@ fn main_result() -> anyhow::Result<i32> {
723
732
}
724
733
Commands :: BenchLocal {
725
734
local,
735
+ opts,
726
736
db,
727
737
bench_rustc,
728
738
iterations,
729
739
self_profile,
730
740
} => {
731
- let profiles = & local . profiles . 0 ;
732
- let scenarios = & local . scenarios . 0 ;
741
+ let profiles = & opts . profiles . 0 ;
742
+ let scenarios = & opts . scenarios . 0 ;
733
743
734
744
let pool = database:: Pool :: open ( & db. db ) ;
735
745
736
746
let toolchain = get_local_toolchain (
737
747
& profiles,
738
748
& local. rustc ,
739
- local . rustdoc . as_deref ( ) ,
749
+ opts . rustdoc . as_deref ( ) ,
740
750
local. cargo . as_deref ( ) ,
741
751
local. id . as_deref ( ) ,
742
752
"" ,
@@ -852,6 +862,7 @@ fn main_result() -> anyhow::Result<i32> {
852
862
Commands :: ProfileLocal {
853
863
profiler,
854
864
local,
865
+ opts,
855
866
out_dir,
856
867
rustc2,
857
868
jobs,
@@ -864,8 +875,8 @@ fn main_result() -> anyhow::Result<i32> {
864
875
) ;
865
876
}
866
877
867
- let profiles = & local . profiles . 0 ;
868
- let scenarios = & local . scenarios . 0 ;
878
+ let profiles = & opts . profiles . 0 ;
879
+ let scenarios = & opts . scenarios . 0 ;
869
880
870
881
let mut benchmarks = get_compile_benchmarks (
871
882
& compile_benchmark_dir,
@@ -887,7 +898,7 @@ fn main_result() -> anyhow::Result<i32> {
887
898
let toolchain = get_local_toolchain (
888
899
& profiles,
889
900
& rustc,
890
- local . rustdoc . as_deref ( ) ,
901
+ opts . rustdoc . as_deref ( ) ,
891
902
local. cargo . as_deref ( ) ,
892
903
local. id . as_deref ( ) ,
893
904
suffix,
0 commit comments