Skip to content

Commit

Permalink
Make --timings=html unstable, and only stabilize --timings
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett committed Jan 31, 2022
1 parent c854247 commit 81e1998
Show file tree
Hide file tree
Showing 33 changed files with 102 additions and 56 deletions.
9 changes: 7 additions & 2 deletions src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub trait AppExt: Sized {
self._arg(
optional_opt(
"timings",
"Timing output formats (comma separated): html, json (unstable)",
"Timing output formats (unstable) (comma separated): html, json",
)
.value_name("FMTS")
.require_equals(true),
Expand Down Expand Up @@ -516,7 +516,12 @@ pub trait ArgMatchesExt {
for timing_output in timing_output.split(',') {
let timing_output = timing_output.to_ascii_lowercase();
let timing_output = match timing_output.as_str() {
"html" => TimingOutput::Html,
"html" => {
config
.cli_unstable()
.fail_if_stable_opt("--timings=html", 7405)?;
TimingOutput::Html
}
"json" => {
config
.cli_unstable()
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-run.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-rustc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-rustdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
4 changes: 3 additions & 1 deletion src/doc/man/generated_txt/cargo-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ OPTIONS
Output information how long each compilation takes, and track
concurrency information over time. Accepts an optional
comma-separated list of output formats; --timing without an argument
will default to --timing=html. Valid output formats:
will default to --timing=html. Specifying an output format (rather
than the default) is unstable and requires -Zunstable-options. Valid
output formats:

o html: Write a human-readable file cargo-timing.html to the
target/cargo-timings directory with a report of the compilation.
Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/includes/options-timings.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{#option "`--timings=`_fmts_"}}
Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; `--timing` without an argument will default to `--timing=html`. Valid
output formats:
formats; `--timing` without an argument will default to `--timing=html`.
Specifying an output format (rather than the default) is unstable and requires
`-Zunstable-options`. Valid output formats:

- `html`: Write a human-readable file `cargo-timing.html` to the
`target/cargo-timings` directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-bench---timings=fmts"><a class="option-anchor" href="#option-cargo-bench---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-build---timings=fmts"><a class="option-anchor" href="#option-cargo-build---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-check---timings=fmts"><a class="option-anchor" href="#option-cargo-check---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-doc---timings=fmts"><a class="option-anchor" href="#option-cargo-doc---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-fix---timings=fmts"><a class="option-anchor" href="#option-cargo-fix---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ See the <a href="../reference/profiles.html">the reference</a> for more details
<dt class="option-term" id="option-cargo-install---timings=fmts"><a class="option-anchor" href="#option-cargo-install---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-run---timings=fmts"><a class="option-anchor" href="#option-cargo-run---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-rustc.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-rustc---timings=fmts"><a class="option-anchor" href="#option-cargo-rustc---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-rustdoc---timings=fmts"><a class="option-anchor" href="#option-cargo-rustdoc---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
5 changes: 3 additions & 2 deletions src/doc/src/commands/cargo-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ required Rust version as configured in the project's <code>rust-version</code> f
<dt class="option-term" id="option-cargo-test---timings=fmts"><a class="option-anchor" href="#option-cargo-test---timings=fmts"></a><code>--timings=</code><em>fmts</em></dt>
<dd class="option-desc">Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma-separated list of output
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>. Valid
output formats:</p>
formats; <code>--timing</code> without an argument will default to <code>--timing=html</code>.
Specifying an output format (rather than the default) is unstable and requires
<code>-Zunstable-options</code>. Valid output formats:</p>
<ul>
<li><code>html</code>: Write a human-readable file <code>cargo-timing.html</code> to the
<code>target/cargo-timings</code> directory with a report of the compilation. Also write
Expand Down
4 changes: 2 additions & 2 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -1297,5 +1297,5 @@ See the [Features chapter](features.md#dependency-features) for more information
### timings

The `-Ztimings` option has been stabilized as `--timings` in the 1.60 release.
(The machine-readable `--timings=json` output remains unstable and requires
`-Zunstable-options`.)
(`--timings=html` and the machine-readable `--timings=json` output remain
unstable and require `-Zunstable-options`.)
5 changes: 3 additions & 2 deletions src/etc/man/cargo-bench.1
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ required Rust version as configured in the project's \fBrust\-version\fR field.
.RS 4
Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma\-separated list of output
formats; \fB\-\-timing\fR without an argument will default to \fB\-\-timing=html\fR\&. Valid
output formats:
formats; \fB\-\-timing\fR without an argument will default to \fB\-\-timing=html\fR\&.
Specifying an output format (rather than the default) is unstable and requires
\fB\-Zunstable\-options\fR\&. Valid output formats:
.sp
.RS 4
\h'-04'\(bu\h'+02'\fBhtml\fR: Write a human\-readable file \fBcargo\-timing.html\fR to the
Expand Down
5 changes: 3 additions & 2 deletions src/etc/man/cargo-build.1
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ required Rust version as configured in the project's \fBrust\-version\fR field.
.RS 4
Output information how long each compilation takes, and track concurrency
information over time. Accepts an optional comma\-separated list of output
formats; \fB\-\-timing\fR without an argument will default to \fB\-\-timing=html\fR\&. Valid
output formats:
formats; \fB\-\-timing\fR without an argument will default to \fB\-\-timing=html\fR\&.
Specifying an output format (rather than the default) is unstable and requires
\fB\-Zunstable\-options\fR\&. Valid output formats:
.sp
.RS 4
\h'-04'\(bu\h'+02'\fBhtml\fR: Write a human\-readable file \fBcargo\-timing.html\fR to the
Expand Down
Loading

0 comments on commit 81e1998

Please sign in to comment.