File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ impl BuildConfig {
115115 ( None , _) => false ,
116116 } ;
117117
118- let timing_outputs = match ( cfg. analysis . enabled , gctx. cli_unstable ( ) . build_analysis ) {
118+ let timing_outputs = match ( cfg. analysis . as_ref ( ) , gctx. cli_unstable ( ) . build_analysis ) {
119119 // Enable HTML output to pretend we are persisting timing data for now.
120- ( true , true ) => vec ! [ TimingOutput :: Html ] ,
121- ( true , false ) => {
120+ ( Some ( analysis ) , true ) if analysis . enabled => vec ! [ TimingOutput :: Html ] ,
121+ ( Some ( _ ) , false ) => {
122122 gctx. shell ( ) . warn (
123123 "ignoring 'build.analysis' config, pass `-Zbuild-analysis` to enable it" ,
124124 ) ?;
Original file line number Diff line number Diff line change @@ -2769,7 +2769,7 @@ pub struct CargoBuildConfig {
27692769 /// Unstable feature `-Zsbom`.
27702770 pub sbom : Option < bool > ,
27712771 /// Unstable feature `-Zbuild-analysis`.
2772- pub analysis : CargoBuildAnalysis ,
2772+ pub analysis : Option < CargoBuildAnalysis > ,
27732773}
27742774
27752775/// Metrics collection for build analysis.
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ fn gated() {
1717 p. cargo ( "check" )
1818 . env ( "CARGO_BUILD_ANALYSIS_ENABLED" , "true" )
1919 . with_stderr_data ( str![ [ r#"
20+ [WARNING] ignoring 'build.analysis' config, pass `-Zbuild-analysis` to enable it
2021[CHECKING] foo v0.0.0 ([ROOT]/foo)
2122[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
2223
@@ -35,6 +36,7 @@ fn gated_no_z_flag() {
3536 . env ( "CARGO_BUILD_ANALYSIS_ENABLED" , "true" )
3637 . masquerade_as_nightly_cargo ( & [ "build-analysis" ] )
3738 . with_stderr_data ( str![ [ r#"
39+ [WARNING] ignoring 'build.analysis' config, pass `-Zbuild-analysis` to enable it
3840[CHECKING] foo v0.0.0 ([ROOT]/foo)
3941[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
4042
@@ -54,6 +56,7 @@ fn simple() {
5456 . masquerade_as_nightly_cargo ( & [ "build-analysis" ] )
5557 . with_stderr_data ( str![ [ r#"
5658[CHECKING] foo v0.0.0 ([ROOT]/foo)
59+ Timing report saved to [ROOT]/foo/target/cargo-timings/cargo-timing-[..].html
5760[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
5861
5962"# ] ] )
You can’t perform that action at this time.
0 commit comments