Skip to content

Commit d721f0f

Browse files
committed
Add unstable -Zsection-timings flag
1 parent 045a797 commit d721f0f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/cargo/core/features.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,7 @@ unstable_cli_options!(
856856
rustdoc_scrape_examples: bool = ("Allows Rustdoc to scrape code examples from reverse-dependencies"),
857857
sbom: bool = ("Enable the `sbom` option in build config in .cargo/config.toml file"),
858858
script: bool = ("Enable support for single-file, `.rs` packages"),
859+
section_timings: bool = ("Enable support for extended compilation sections in --timings output"),
859860
separate_nightlies: bool,
860861
skip_rustdoc_fingerprint: bool,
861862
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
@@ -1380,6 +1381,7 @@ impl CliUnstable {
13801381
"rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?,
13811382
"rustdoc-scrape-examples" => self.rustdoc_scrape_examples = parse_empty(k, v)?,
13821383
"sbom" => self.sbom = parse_empty(k, v)?,
1384+
"section-timings" => self.section_timings = parse_empty(k, v)?,
13831385
"separate-nightlies" => self.separate_nightlies = parse_empty(k, v)?,
13841386
"checksum-freshness" => self.checksum_freshness = parse_empty(k, v)?,
13851387
"skip-rustdoc-fingerprint" => self.skip_rustdoc_fingerprint = parse_empty(k, v)?,

src/doc/src/reference/unstable.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,18 @@ For example:
19381938
cargo +nightly fix -Zfix-edition=end=2024,future
19391939
```
19401940

1941+
## section-timings
1942+
* Original Pull Request: [#15780](https://github.com/rust-lang/cargo/pull/15780)
1943+
* Tracking Issue: [#15817](https://github.com/rust-lang/cargo/issues/15817)
1944+
1945+
This feature can be used to extend the output of `cargo build --timings`. It will tell rustc
1946+
to produce timings of individual compilation sections, which will be then displayed in the timings
1947+
HTML/JSON output.
1948+
1949+
```console
1950+
cargo +nightly -Zsection-timings build --timings
1951+
```
1952+
19411953
# Stabilized and removed features
19421954

19431955
## Compile progress

0 commit comments

Comments
 (0)